diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-02-18 21:53:19 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-02-18 21:59:18 +0100 |
commit | 743f7216de98556a316301ac72b8606bafc2deee (patch) | |
tree | dc8fef8834846139df1c1dc4e8915a71e1c8abc0 /test/Tests/Readers | |
parent | ef741f384232d70cc617b9d06d0163b23e482258 (diff) | |
download | pandoc-743f7216de98556a316301ac72b8606bafc2deee.tar.gz |
Org reader: fix bug in org-ref citation parsing.
The org-ref syntax allows to list multiple citations separated by comma.
This fixes a bug that accepted commas as part of the citation id, so all
citation lists were parsed as one single citation.
Fixes: #7101
Diffstat (limited to 'test/Tests/Readers')
-rw-r--r-- | test/Tests/Readers/Org/Inline/Citation.hs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/Tests/Readers/Org/Inline/Citation.hs b/test/Tests/Readers/Org/Inline/Citation.hs index 5538f1ec8..a11804983 100644 --- a/test/Tests/Readers/Org/Inline/Citation.hs +++ b/test/Tests/Readers/Org/Inline/Citation.hs @@ -116,6 +116,46 @@ tests = } in (para $ cite [citation] "citep:pandoc") + , "multiple simple citations" =: + "citep:picard,riker" =?> + let picard = Citation + { citationId = "picard" + , citationPrefix = mempty + , citationSuffix = mempty + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + riker = Citation + { citationId = "riker" + , citationPrefix = mempty + , citationSuffix = mempty + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + in (para $ cite [picard,riker] "citep:picard,riker") + + , "multiple simple citations succeeded by comma" =: + "citep:picard,riker," =?> + let picard = Citation + { citationId = "picard" + , citationPrefix = mempty + , citationSuffix = mempty + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + riker = Citation + { citationId = "riker" + , citationPrefix = mempty + , citationSuffix = mempty + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + in (para $ cite [picard,riker] "citep:picard,riker" <> str ",") + , "extended citation" =: "[[citep:Dominik201408][See page 20::, for example]]" =?> let citation = Citation |