summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-04-26 23:17:34 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-04-26 23:17:34 -0700
commitd253955a7e4b46be0aa27e4b3686a0ecfb134f19 (patch)
tree9807c66f6f3f96e25cb7b07fadac82cf1480a01f /src/Text
parent4aaa1991fdf950e569b3a1565fc0e63a0261ae51 (diff)
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.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs11
1 files changed, 8 insertions, 3 deletions
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