mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 05:43:39 +08:00
T.P.LaTeX.Parsing: change type on rawLaTeXParser.
The preparser doesn't need to return a value.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user