From 0a93acf91a116911f2c6c6add4f153cc80d15181 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 20 Oct 2021 10:14:42 -0700 Subject: Markdown reader: don't parse links or bracketed spans as citations. Previously pandoc would parse [link to (@a)](url) as a citation; similarly [(@a)]{#ident} This is undesirable. One should be able to use example references in citations, and even if `@a` is not defined as an example reference, `[@a](url)` should be a link containing an author-in-text citation rather than a normal citation followed by literal `(url)`. Closes #7632. --- test/command/7632.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 test/command/7632.md (limited to 'test/command') diff --git a/test/command/7632.md b/test/command/7632.md new file mode 100644 index 000000000..4256bc207 --- /dev/null +++ b/test/command/7632.md @@ -0,0 +1,66 @@ +``` +% pandoc -t native +(@a) First case + +[link to (@a)](url) +^D +[ OrderedList + ( 1 , Example , TwoParens ) + [ [ Plain [ Str "First" , Space , Str "case" ] ] ] +, Para + [ Link + ( "" , [] , [] ) + [ Str "link" , Space , Str "to" , Space , Str "(1)" ] + ( "url" , "" ) + ] +] +``` + +``` +% pandoc -t native +[@a]{.class} +^D +[ Para + [ Span + ( "" , [ "class" ] , [] ) + [ Cite + [ Citation + { citationId = "a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@a" ] + ] + ] +] + +``` + +``` +% pandoc -t native +[@a](url) +^D +[ Para + [ Link + ( "" , [] , [] ) + [ Cite + [ Citation + { citationId = "a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@a" ] + ] + ( "url" , "" ) + ] +] + +``` -- cgit v1.2.3