git.iko.soy/typeable/pandoc
on master help sign in
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.

commitd253955a7e4b46be0aa27e4b3686a0ecfb134f19 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 26 Apr 2010, 23:17 (17 years ago) parent4aaa199
1 file changed+8−3
src/Text/Pandoc/Readers/LaTeX.hs+8−3
src/Text/Pandoc/Readers/LaTeX.hs+8−3
@@ -453,7 +453,7 @@ inline = choice [ str
453453 , accentedChar
454454 , nonbreakingSpace
455455 , specialChar
456− , rawLaTeXInline
456+ , rawLaTeXInline'
457457 , escapedChar
458458 , unescapedChar
459459 ] <?> "inline"
@@ -771,11 +771,16 @@ footnote = try $ do
771771 setInput rest
772772 return $ Note blocks
773773
774+-- | Parse any LaTeX inline command and return it in a raw TeX inline element.
775+rawLaTeXInline' :: GenParser Char ParserState Inline
776+rawLaTeXInline' = do
777+ notFollowedBy' $ oneOfStrings ["\\begin", "\\end", "\\item", "\\ignore",
778+ "\\section"]
779+ rawLaTeXInline
780+
774781-- | Parse any LaTeX command and return it in a raw TeX inline element.
775782rawLaTeXInline :: GenParser Char ParserState Inline
776783rawLaTeXInline = try $ do
777− notFollowedBy' $ oneOfStrings ["\\begin", "\\end", "\\item", "\\ignore",
778− "\\section"]
779784 state <- getState
780785 if stateParseRaw state
781786 then do