diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-08-08 10:52:53 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-08-08 10:52:59 -0700 |
commit | 9aa9d5cf68386acd127427cc62f6004b2a17057a (patch) | |
tree | ecbbdab82e46aaddfd326ad37d8b280b591f4df8 /src/Text | |
parent | 12e7ec40707bfb716bb9add82e4320558e065492 (diff) | |
download | pandoc-9aa9d5cf68386acd127427cc62f6004b2a17057a.tar.gz |
Revert "Textile reader: Removed raw LaTeX parsing."
This reverts commit bb61624bb2bba416e1992ecdf101f9660a3edcae.
Apparently someone put this there for a reason, since it's in
the test suite.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Textile.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index d4f092d07..9191f6908 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -56,6 +56,7 @@ import Text.Pandoc.Shared import Text.Pandoc.Options import Text.Pandoc.Parsing import Text.Pandoc.Readers.HTML ( htmlTag, isInlineTag, isBlockTag ) +import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock ) import Text.HTML.TagSoup (parseTags, innerText, fromAttrib, Tag(..)) import Text.HTML.TagSoup.Match import Data.List ( intercalate ) @@ -125,6 +126,7 @@ blockParsers = [ codeBlock , commentBlock , anyList , rawHtmlBlock + , rawLaTeXBlock' , maybeExplicitBlock "table" table , maybeExplicitBlock "p" para ] @@ -290,6 +292,13 @@ rawHtmlBlock = try $ do optional blanklines return $ RawBlock "html" b +-- | Raw block of LaTeX content +rawLaTeXBlock' :: Parser [Char] ParserState Block +rawLaTeXBlock' = do + guardEnabled Ext_raw_tex + RawBlock "latex" <$> (rawLaTeXBlock <* spaces) + + -- | In textile, paragraphs are separated by blank lines. para :: Parser [Char] ParserState Block para = try $ Para . normalizeSpaces <$> manyTill inline blockBreak @@ -364,6 +373,7 @@ inlineParsers = [ str , escapedInline , htmlSpan , rawHtmlInline + , rawLaTeXInline' , note , try $ (char '[' *> inlineMarkup <* char ']') , inlineMarkup @@ -479,6 +489,12 @@ endline = try $ do rawHtmlInline :: Parser [Char] ParserState Inline rawHtmlInline = RawInline "html" . snd <$> htmlTag isInlineTag +-- | Raw LaTeX Inline +rawLaTeXInline' :: Parser [Char] ParserState Inline +rawLaTeXInline' = try $ do + guardEnabled Ext_raw_tex + rawLaTeXInline + -- | Textile standard link syntax is "label":target. But we -- can also have ["label":target]. link :: Parser [Char] ParserState Inline |