From d253955a7e4b46be0aa27e4b3686a0ecfb134f19 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 26 Apr 2010 23:17:34 -0700 Subject: Changed rawLaTeXInline to accept '\section', '\begin', etc. Use new rawLaTeXInline' in LaTeX reader, and export rawLaTeXInline for use in markdown reader. Fixes bug wherein '\section{foo}' was not recognized as raw TeX in markdown document. --- src/Text/Pandoc/Readers/LaTeX.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 36940fab0..01fca9f2b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -453,7 +453,7 @@ inline = choice [ str , accentedChar , nonbreakingSpace , specialChar - , rawLaTeXInline + , rawLaTeXInline' , escapedChar , unescapedChar ] "inline" @@ -771,11 +771,16 @@ footnote = try $ do setInput rest return $ Note blocks +-- | Parse any LaTeX inline command and return it in a raw TeX inline element. +rawLaTeXInline' :: GenParser Char ParserState Inline +rawLaTeXInline' = do + notFollowedBy' $ oneOfStrings ["\\begin", "\\end", "\\item", "\\ignore", + "\\section"] + rawLaTeXInline + -- | Parse any LaTeX command and return it in a raw TeX inline element. rawLaTeXInline :: GenParser Char ParserState Inline rawLaTeXInline = try $ do - notFollowedBy' $ oneOfStrings ["\\begin", "\\end", "\\item", "\\ignore", - "\\section"] state <- getState if stateParseRaw state then do -- cgit v1.2.3