LaTeX reader: Fixed comments inside citations. Closes #4374.

This commit is contained in:
John MacFarlane 2018-02-17 23:06:54 -08:00
parent 3535af0197
commit 377640402f
2 changed files with 10 additions and 3 deletions

View file

@ -1074,12 +1074,12 @@ simpleCiteArgs = try $ do
citationLabel :: PandocMonad m => LP m String
citationLabel = do
optional sp
optional spaces
toksToString <$>
(many1 (satisfyTok isWordTok <|> symbolIn bibtexKeyChar)
<* optional sp
<* optional spaces
<* optional (symbol ',')
<* optional sp)
<* optional spaces)
where bibtexKeyChar = ".:;?!`'()/*@_+=-[]" :: [Char]
cites :: PandocMonad m => CitationMode -> Bool -> LP m [Citation]

7
test/command/4374.md Normal file
View file

@ -0,0 +1,7 @@
```
% pandoc -f latex -t native
\cite{a%
}
^D
[Para [Cite [Citation {citationId = "a", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cite{a%\n}"]]]
```