diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-12-14 19:34:28 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-12-14 19:34:28 -0800 |
commit | 3ac6f72f988da20af7d460868fc1971b3ea63758 (patch) | |
tree | 175ea8a6d0b7d82400389d2a155bbe8a45a88509 /src/Text/Pandoc | |
parent | 34d30efc5c58b8f60c44f5db369a3056780f654a (diff) | |
download | pandoc-3ac6f72f988da20af7d460868fc1971b3ea63758.tar.gz |
Fixed preamble parsing in LaTeX reader.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index f02d7a564..70a913a1b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -120,7 +120,8 @@ anyEnvironment = try $ do -- | Process LaTeX preamble, extracting metadata. processLaTeXPreamble :: GenParser Char ParserState () processLaTeXPreamble = - skipMany $ notFollowedBy' anyEnvironment >> block + skipMany $ choice [ bibliographic, unknownCommand, + commentBlock, skipToken ] -- | Parse LaTeX and return 'Pandoc'. parseLaTeX :: GenParser Char ParserState Pandoc @@ -156,7 +157,9 @@ block = choice [ hrule , itemBlock , unknownEnvironment , ignore - , unknownCommand ] <?> "block" + , unknownCommand + , skipToken + ] <?> "block" -- -- header blocks @@ -435,6 +438,9 @@ unknownCommand = try $ do commandsToIgnore :: [String] commandsToIgnore = ["special","pdfannot","pdfstringdef","bibliography"] +skipToken :: GenParser Char ParserState Block +skipToken = satisfy (/='\\') >> spaces >> return Null + commentBlock :: GenParser Char st Block commentBlock = comment >> return Null |