diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-30 08:21:48 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-30 08:21:48 -0800 |
commit | 71ca44db6e8893b0394e6cd38c637deee0524371 (patch) | |
tree | 3eeeb1b17fd690558611dd522556d539885ab059 /src/Text/Pandoc | |
parent | 2a9f55cd785301e37f45f9c8e0666b1159e4c109 (diff) | |
download | pandoc-71ca44db6e8893b0394e6cd38c637deee0524371.tar.gz |
LaTeX reader: Fixed bug with whitespace at beginning of file.
Previously a file beginning " hi" would cause a parse error.
Also cleaned up comment parsing.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 83b74a489..dca745b56 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -136,8 +136,8 @@ processLaTeXPreamble = do -- | Parse LaTeX and return 'Pandoc'. parseLaTeX :: GenParser Char ParserState Pandoc parseLaTeX = do - skipMany $ spaces >> comment spaces + skipMany $ comment >> spaces blocks <- try (processLaTeXPreamble >> environment "document") <|> (many block >>~ (spaces >> eof)) state <- getState @@ -528,7 +528,7 @@ skipChar = do return Null commentBlock :: GenParser Char st Block -commentBlock = comment >> return Null +commentBlock = many1 (comment >> spaces) >> return Null -- -- inline |