diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Inlines.hs | 2 | ||||
-rw-r--r-- | test/Tests/Readers/Org/Inline/Citation.hs | 40 |
2 files changed, 41 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs index 68c2ba5e0..519a6ce04 100644 --- a/src/Text/Pandoc/Readers/Org/Inlines.hs +++ b/src/Text/Pandoc/Readers/Org/Inlines.hs @@ -322,7 +322,7 @@ linkLikeOrgRefCite = try $ do -- from the `org-ref-cite-re` variable in `org-ref.el`. orgRefCiteKey :: PandocMonad m => OrgParser m Text orgRefCiteKey = - let citeKeySpecialChars = "-_:\\./," :: String + let citeKeySpecialChars = "-_:\\./" :: String isCiteKeySpecialChar c = c `elem` citeKeySpecialChars isCiteKeyChar c = isAlphaNum c || isCiteKeySpecialChar c endOfCitation = try $ do 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 |