git.iko.soy/typeable/pandoc
on master help sign in
Org reader: fix bug in org-ref citation parsing.
743f721Albert Krewinkel
src/Text/Pandoc/Readers/Org/Inlines.hs+1−1
@@ -322,7 +322,7 @@ linkLikeOrgRefCite = try $ do
322-- from the `org-ref-cite-re` variable in `org-ref.el`.
322-- from the `org-ref-cite-re` variable in `org-ref.el`.
323orgRefCiteKey :: PandocMonad m => OrgParser m Text
323orgRefCiteKey :: PandocMonad m => OrgParser m Text
324orgRefCiteKey =
324orgRefCiteKey =
325− let citeKeySpecialChars = "-_:\\./," :: String
325+ let citeKeySpecialChars = "-_:\\./" :: String
326 isCiteKeySpecialChar c = c `elem` citeKeySpecialChars
326 isCiteKeySpecialChar c = c `elem` citeKeySpecialChars
327 isCiteKeyChar c = isAlphaNum c || isCiteKeySpecialChar c
327 isCiteKeyChar c = isAlphaNum c || isCiteKeySpecialChar c
328 endOfCitation = try $ do
328 endOfCitation = try $ do
test/Tests/Readers/Org/Inline/Citation.hs+40
@@ -116,6 +116,46 @@ tests =
116 }
116 }
117 in (para $ cite [citation] "citep:pandoc")
117 in (para $ cite [citation] "citep:pandoc")
118
118
119+ , "multiple simple citations" =:
120+ "citep:picard,riker" =?>
121+ let picard = Citation
122+ { citationId = "picard"
123+ , citationPrefix = mempty
124+ , citationSuffix = mempty
125+ , citationMode = NormalCitation
126+ , citationNoteNum = 0
127+ , citationHash = 0
128+ }
129+ riker = Citation
130+ { citationId = "riker"
131+ , citationPrefix = mempty
132+ , citationSuffix = mempty
133+ , citationMode = NormalCitation
134+ , citationNoteNum = 0
135+ , citationHash = 0
136+ }
137+ in (para $ cite [picard,riker] "citep:picard,riker")
138+
139+ , "multiple simple citations succeeded by comma" =:
140+ "citep:picard,riker," =?>
141+ let picard = Citation
142+ { citationId = "picard"
143+ , citationPrefix = mempty
144+ , citationSuffix = mempty
145+ , citationMode = NormalCitation
146+ , citationNoteNum = 0
147+ , citationHash = 0
148+ }
149+ riker = Citation
150+ { citationId = "riker"
151+ , citationPrefix = mempty
152+ , citationSuffix = mempty
153+ , citationMode = NormalCitation
154+ , citationNoteNum = 0
155+ , citationHash = 0
156+ }
157+ in (para $ cite [picard,riker] "citep:picard,riker" <> str ",")
158+
119 , "extended citation" =:
159 , "extended citation" =:
120 "[[citep:Dominik201408][See page 20::, for example]]" =?>
160 "[[citep:Dominik201408][See page 20::, for example]]" =?>
121 let citation = Citation
161 let citation = Citation