aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index a8df5dd03..b4e9de258 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -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