T.P.LaTeX.Parsing: change type on rawLaTeXParser.

The preparser doesn't need to return a value.
This commit is contained in:
John MacFarlane
2025-11-04 13:12:27 +01:00
parent b106dca069
commit 0e4c9b0ea6
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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:
+1 -1
View File
@@ -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