LaTeX reader: Fixed comments inside citations. Closes #4374.
commit377640402f32e8189fc88e54515c397ce48cc916
authorJohn MacFarlane <jgm@berkeley.edu>
dateSat 17 Feb 2018, 23:06 (9 years ago)
parent3535af0
src/Text/Pandoc/Readers/LaTeX.hs+3−3
@@ -1074,12 +1074,12 @@ simpleCiteArgs = try $ do
10741074
10751075citationLabel :: PandocMonad m => LP m String
10761076citationLabel = do
1077− optional sp
1077+ optional spaces
10781078 toksToString <$>
10791079 (many1 (satisfyTok isWordTok <|> symbolIn bibtexKeyChar)
1080− <* optional sp
1080+ <* optional spaces
10811081 <* optional (symbol ',')
1082− <* optional sp)
1082+ <* optional spaces)
10831083 where bibtexKeyChar = ".:;?!`'()/*@_+=-[]" :: [Char]
10841084
10851085cites :: PandocMonad m => CitationMode -> Bool -> LP m [Citation]
test/command/4374.mdnew file+7
@@ -0,0 +1,7 @@
1+```
2+% pandoc -f latex -t native
3+\cite{a%
4+}
5+^D
6+[Para [Cite [Citation {citationId = "a", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cite{a%\n}"]]]
7+```