diff options
| author | John MacFarlane <[email protected]> | 2025-11-04 13:12:27 +0100 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-11-04 13:12:27 +0100 |
| commit | 0e4c9b0ea6b6fd702083eaa4f42ea3cb6c9a556e (patch) | |
| tree | b88b102ddbd4463c5fab22d64f8ff0a5d2a61c84 /src | |
| parent | b106dca0693a26b8f134bb8550fe6ea5a83f3346 (diff) | |
T.P.LaTeX.Parsing: change type on rawLaTeXParser.
The preparser doesn't need to return a value.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 6 | ||||
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index c9d2d62d3..11419b15f 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -151,7 +151,7 @@ rawLaTeXBlock = do braced return mempty) blocks <|> rawLaTeXParser toks - (environment <|> blockCommand) + (void (environment <|> blockCommand)) (mconcat <$> many (block <|> beginOrEndCommand))) -- See #4667 for motivation; sometimes people write macros @@ -177,7 +177,7 @@ rawLaTeXInline = do ( rawLaTeXParser toks (mempty <$ (controlSeq "input" >> skipMany rawopt >> braced)) inlines - <|> rawLaTeXParser toks inline inlines + <|> rawLaTeXParser toks (void inline) inlines ) finalbraces <- mconcat <$> many (try (string "{}")) -- see #5439 return $ raw <> T.pack finalbraces @@ -186,7 +186,7 @@ inlineCommand :: PandocMonad m => ParsecT Sources ParserState m Inlines inlineCommand = do lookAhead (try (char '\\' >> letter)) toks <- getInputTokens - fst <$> rawLaTeXParser toks (inlineEnvironment <|> inlineCommand') + fst <$> rawLaTeXParser toks (void (inlineEnvironment <|> inlineCommand')) inlines -- inline elements: diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index bb76f6e18..54c43ef2e 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -279,7 +279,7 @@ withVerbatimMode parser = do return result rawLaTeXParser :: (PandocMonad m, HasMacros s, HasReaderOptions s, Show a) - => [Tok] -> LP m a -> LP m a + => [Tok] -> LP m () -> LP m a -> ParsecT Sources s m (a, Text) rawLaTeXParser toks parser valParser = do pstate <- getState |
