From ed73bd28e511f72b17fc84126da85410e13b396b Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Tue, 21 May 2019 11:31:38 -0400 Subject: Markdown writer: Handle labels with integer names Previously if labels had integer names, it could produce a conflict with auto-labeled reference links. Now we test for a conflict and find the next available integer. Note that this involves adding a new state variable `stPrevRefs` to keep track of refs used in other document parts when using `--reference-location=block|section` Closes #5495 --- test/command/5495.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/command/5495.md (limited to 'test') diff --git a/test/command/5495.md b/test/command/5495.md new file mode 100644 index 000000000..37370ccab --- /dev/null +++ b/test/command/5495.md @@ -0,0 +1,18 @@ +``` +% pandoc -t markdown --reference-links +All because of [1](#one) link... + +[This](#foo) will break Pandoc. + +[This](#bar) will make you laugh. +^D +All because of [1] link... + +[This] will break Pandoc. + +[This][2] will make you laugh. + + [1]: #one + [This]: #foo + [2]: #bar +``` -- cgit v1.2.3