LaTeX reader: Don't omit macro definitions defined in the preamble.

These were formerly omitted (though they still affected macro
resolution if `latex_macros` was set).  Now they are included in
the document.
This commit is contained in:
John MacFarlane 2019-11-02 11:04:21 -07:00
parent 15e1ca6441
commit 7fac395284

View file

@ -1462,13 +1462,14 @@ end_ t = try (do
guard $ t == txt) <?> ("\\end{" ++ T.unpack t ++ "}")
preamble :: PandocMonad m => LP m Blocks
preamble = mempty <$ many preambleBlock
where preambleBlock = spaces1
<|> macroDef (const ())
<|> void blockCommand
<|> void braced
preamble = mconcat <$> many preambleBlock
where preambleBlock = (mempty <$ spaces1)
<|> macroDef (rawBlock "latex")
<|> (mempty <$ blockCommand)
<|> (mempty <$ braced)
<|> (do notFollowedBy (begin_ "document")
void anyTok)
anyTok
return mempty)
paragraph :: PandocMonad m => LP m Blocks
paragraph = do