diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2018-02-17 23:06:54 -0800 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2018-02-17 23:06:54 -0800 |
| commit | 377640402f32e8189fc88e54515c397ce48cc916 (patch) | |
| tree | 806397826bed907a5d9e290dfecac1906549f94f | |
| parent | 3535af019722fc5086e968cc485ab8b94b76f1fd (diff) | |
| download | pandoc-377640402f32e8189fc88e54515c397ce48cc916.tar.gz | |
LaTeX reader: Fixed comments inside citations. Closes #4374.
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 6 | ||||
| -rw-r--r-- | test/command/4374.md | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 1ce3d18e5..cb70b6403 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -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] diff --git a/test/command/4374.md b/test/command/4374.md new file mode 100644 index 000000000..296c116a9 --- /dev/null +++ b/test/command/4374.md @@ -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}"]]] +``` |
