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

commit9aa9d5cf68386acd127427cc62f6004b2a17057a authorJohn MacFarlane <jgm@berkeley.edu> dateThu 8 Aug 2013, 10:52 (13 years ago) parent12e7ec4
1 file changed+16
src/Text/Pandoc/Readers/Textile.hs+16
src/Text/Pandoc/Readers/Textile.hs+16
@@ -56,6 +56,7 @@ import Text.Pandoc.Shared
5656import Text.Pandoc.Options
5757import Text.Pandoc.Parsing
5858import Text.Pandoc.Readers.HTML ( htmlTag, isInlineTag, isBlockTag )
59+import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
5960import Text.HTML.TagSoup (parseTags, innerText, fromAttrib, Tag(..))
6061import Text.HTML.TagSoup.Match
6162import Data.List ( intercalate )
@@ -125,6 +126,7 @@ blockParsers = [ codeBlock
125126 , commentBlock
126127 , anyList
127128 , rawHtmlBlock
129+ , rawLaTeXBlock'
128130 , maybeExplicitBlock "table" table
129131 , maybeExplicitBlock "p" para
130132 ]
@@ -290,6 +292,13 @@ rawHtmlBlock = try $ do
290292 optional blanklines
291293 return $ RawBlock "html" b
292294
295+-- | Raw block of LaTeX content
296+rawLaTeXBlock' :: Parser [Char] ParserState Block
297+rawLaTeXBlock' = do
298+ guardEnabled Ext_raw_tex
299+ RawBlock "latex" <$> (rawLaTeXBlock <* spaces)
300+
301+
293302-- | In textile, paragraphs are separated by blank lines.
294303para :: Parser [Char] ParserState Block
295304para = try $ Para . normalizeSpaces <$> manyTill inline blockBreak
@@ -364,6 +373,7 @@ inlineParsers = [ str
364373 , escapedInline
365374 , htmlSpan
366375 , rawHtmlInline
376+ , rawLaTeXInline'
367377 , note
368378 , try $ (char '[' *> inlineMarkup <* char ']')
369379 , inlineMarkup
@@ -479,6 +489,12 @@ endline = try $ do
479489rawHtmlInline :: Parser [Char] ParserState Inline
480490rawHtmlInline = RawInline "html" . snd <$> htmlTag isInlineTag
481491
492+-- | Raw LaTeX Inline
493+rawLaTeXInline' :: Parser [Char] ParserState Inline
494+rawLaTeXInline' = try $ do
495+ guardEnabled Ext_raw_tex
496+ rawLaTeXInline
497+
482498-- | Textile standard link syntax is "label":target. But we
483499-- can also have ["label":target].
484500link :: Parser [Char] ParserState Inline