aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs6
-rw-r--r--test/command/4374.md7
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}"]]]
+```