aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-10-20 10:14:42 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-10-20 10:34:47 -0700
commit0a93acf91a116911f2c6c6add4f153cc80d15181 (patch)
treede7afaf6f4a567fb90b2c8382983e00fd7b4bc6f /test
parent7754b7f2ddd8b188de66b4c0f0b4a87d2a2045c6 (diff)
downloadpandoc-0a93acf91a116911f2c6c6add4f153cc80d15181.tar.gz
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.
Diffstat (limited to 'test')
-rw-r--r--test/command/7632.md66
1 files changed, 66 insertions, 0 deletions
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" , "" )
+ ]
+]
+
+```