diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-02-05 09:48:42 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-02-05 09:48:42 -0800 |
commit | 9c4dc8b49b3894d51aa37fbcff1c228776ffb98f (patch) | |
tree | e5fb3f27d90fb897186b98c06dd755c647b23b5b /src/Text/Pandoc/Readers/LaTeX | |
parent | b018028ee9f733d5c6907e4ef362794e75b8c38c (diff) | |
download | pandoc-9c4dc8b49b3894d51aa37fbcff1c228776ffb98f.tar.gz |
LaTeX reader: skip comments in more places where this is needed.
Closes #6114.
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 6 |
1 files changed, 4 insertions, 2 deletions
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 |