LaTeX reader: Ensure that preamble doesn't contribute to text of doc.

This commit is contained in:
John MacFarlane 2013-10-11 22:43:47 -07:00
parent de10b1653e
commit 1a55c8f5de

View file

@ -1037,14 +1037,14 @@ paragraph = do
preamble :: LP Blocks
preamble = mempty <$> manyTill preambleBlock beginDoc
where beginDoc = lookAhead $ controlSeq "begin" *> string "{document}"
preambleBlock = (mempty <$ comment)
<|> (mempty <$ sp)
<|> (mempty <$ blanklines)
<|> (mempty <$ macro)
<|> blockCommand
<|> (mempty <$ anyControlSeq)
<|> (mempty <$ braced)
<|> (mempty <$ anyChar)
preambleBlock = (void comment)
<|> (void sp)
<|> (void blanklines)
<|> (void macro)
<|> (void blockCommand)
<|> (void anyControlSeq)
<|> (void braced)
<|> (void anyChar)
-------