From 9c4dc8b49b3894d51aa37fbcff1c228776ffb98f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 5 Feb 2020 09:48:42 -0800 Subject: LaTeX reader: skip comments in more places where this is needed. Closes #6114. --- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers/LaTeX') diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index a01abda46..5630ed868 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -528,7 +528,9 @@ symbolIn cs = satisfyTok isInCs isInCs _ = False sp :: PandocMonad m => LP m () -sp = whitespace <|> endline +sp = do + optional $ skipMany (whitespace <|> comment) + optional $ endline *> skipMany (whitespace <|> comment) whitespace :: PandocMonad m => LP m () whitespace = () <$ satisfyTok isSpaceTok @@ -595,7 +597,7 @@ primEscape = do bgroup :: PandocMonad m => LP m Tok bgroup = try $ do - skipMany sp + optional sp symbol '{' <|> controlSeq "bgroup" <|> controlSeq "begingroup" egroup :: PandocMonad m => LP m Tok -- cgit v1.2.3