git.iko.soy/typeable/pandoc
on master help sign in
Bumped version to 1.8; depend on pandoc-types 1.8.

The old TeX, HtmlInline and RawHtml elements have been removed and replaced by generic RawInline and RawBlock elements. All modules updated to use the new raw elements.

commitbd43c0f4c940b755e2d68c7146c7f5201fb181d9 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 23 Jan 2011, 10:55 (16 years ago) parent5bee388
39 files changed+186−156
pandoc.cabal+3−3 src/Text/Pandoc/Parsing.hs+6−7 src/Text/Pandoc/Readers/HTML.hs+2−2 src/Text/Pandoc/Readers/LaTeX.hs+2−2 src/Text/Pandoc/Readers/Markdown.hs+10−10 src/Text/Pandoc/Readers/RST.hs+5−3 src/Text/Pandoc/Readers/Textile.hs+3−2 src/Text/Pandoc/Shared.hs+4−7 src/Text/Pandoc/Writers/ConTeXt.hs+8−3 src/Text/Pandoc/Writers/Docbook.hs+5−3 src/Text/Pandoc/Writers/EPUB.hs+3−3 src/Text/Pandoc/Writers/HTML.hs+11−9 src/Text/Pandoc/Writers/LaTeX.hs+5−4 src/Text/Pandoc/Writers/Man.hs+4−3 src/Text/Pandoc/Writers/Markdown.hs+11−9 src/Text/Pandoc/Writers/MediaWiki.hs+6−4 src/Text/Pandoc/Writers/OpenDocument.hs+4−3 src/Text/Pandoc/Writers/Org.hs+6−3 src/Text/Pandoc/Writers/RST.hs+3−4 src/Text/Pandoc/Writers/RTF.hs+4−3 src/Text/Pandoc/Writers/Texinfo.hs+8−3 src/Text/Pandoc/Writers/Textile.hs+8−4 tests/Tests/Arbitrary.hs+7−1 tests/latex-reader.native+1−1 tests/markdown-reader-more.native+4−4 tests/rst-reader.native+3−3 tests/testsuite.native+18−18 tests/textile-reader.native+6−6 tests/writer.context−1 tests/writer.docbook−2 tests/writer.html−2 tests/writer.latex−1 tests/writer.man−1 tests/writer.mediawiki−1 tests/writer.native+18−18 tests/writer.rst+8 tests/writer.rtf−1 tests/writer.texinfo−1 tests/writer.textile−1
pandoc.cabal+3−3
@@ -1,5 +1,5 @@
11Name: pandoc
2−Version: 1.7
2+Version: 1.8
33Cabal-Version: >= 1.6
44Build-Type: Custom
55License: GPL
@@ -202,7 +202,7 @@ Library
202202 random >= 1 && < 1.1,
203203 extensible-exceptions >= 0.1 && < 0.2,
204204 citeproc-hs >= 0.3 && < 0.4,
205− pandoc-types == 1.7.*,
205+ pandoc-types == 1.8.*,
206206 json >= 0.4 && < 0.5,
207207 dlist >= 0.4 && < 0.6,
208208 tagsoup >= 0.12 && < 0.13
@@ -286,7 +286,7 @@ Executable pandoc
286286 random >= 1 && < 1.1,
287287 extensible-exceptions >= 0.1 && < 0.2,
288288 citeproc-hs >= 0.3 && < 0.4,
289− pandoc-types == 1.7.*,
289+ pandoc-types == 1.8.*,
290290 json >= 0.4 && < 0.5,
291291 dlist >= 0.4 && < 0.6,
292292 tagsoup >= 0.12 && < 0.13
src/Text/Pandoc/Parsing.hs+6−7
@@ -662,13 +662,12 @@ newtype Key = Key [Inline] deriving (Show, Read, Eq, Ord)
662662toKey :: [Inline] -> Key
663663toKey = Key . bottomUp lowercase
664664 where lowercase :: Inline -> Inline
665− lowercase (Str xs) = Str (map toLower xs)
666− lowercase (Math t xs) = Math t (map toLower xs)
667− lowercase (Code xs) = Code (map toLower xs)
668− lowercase (TeX xs) = TeX (map toLower xs)
669− lowercase (HtmlInline xs) = HtmlInline (map toLower xs)
670− lowercase LineBreak = Space
671− lowercase x = x
665+ lowercase (Str xs) = Str (map toLower xs)
666+ lowercase (Math t xs) = Math t (map toLower xs)
667+ lowercase (Code xs) = Code (map toLower xs)
668+ lowercase (RawInline f xs) = RawInline f (map toLower xs)
669+ lowercase LineBreak = Space
670+ lowercase x = x
672671
673672fromKey :: Key -> [Inline]
674673fromKey (Key xs) = xs
src/Text/Pandoc/Readers/HTML.hs+2−2
@@ -169,7 +169,7 @@ pRawHtmlBlock = do
169169 raw <- pHtmlBlock "script" <|> pHtmlBlock "style" <|> pRawTag
170170 state <- getState
171171 if stateParseRaw state && not (null raw)
172− then return [RawHtml raw]
172+ then return [RawBlock "html" raw]
173173 else return []
174174
175175pHtmlBlock :: String -> TagParser String
@@ -347,7 +347,7 @@ pRawHtmlInline = do
347347 result <- pSatisfy (tagComment (const True)) <|> pSatisfy isInlineTag
348348 state <- getState
349349 if stateParseRaw state
350− then return [HtmlInline $ renderTags' [result]]
350+ then return [RawInline "html" $ renderTags' [result]]
351351 else return []
352352
353353pInlinesInTags :: String -> ([Inline] -> Inline)
src/Text/Pandoc/Readers/LaTeX.hs+2−2
@@ -448,7 +448,7 @@ rawLaTeXEnvironment :: GenParser Char st Block
448448rawLaTeXEnvironment = do
449449 contents <- rawLaTeXEnvironment'
450450 spaces
451− return $ Para [TeX contents]
451+ return $ RawBlock "latex" contents
452452
453453-- | Parse any LaTeX environment and return a string containing
454454-- the whole literal environment as raw TeX.
@@ -491,7 +491,7 @@ demacro (n,st,args) = try $ do
491491 let raw = "\\" ++ n ++ st ++ concat args
492492 s' <- applyMacros' raw
493493 if raw == s'
494− then return $ TeX raw
494+ then return $ RawInline "latex" raw
495495 else do
496496 inp <- getInput
497497 setInput $ s' ++ inp
src/Text/Pandoc/Readers/Markdown.hs+10−10
@@ -661,10 +661,10 @@ definitionList = do
661661--
662662
663663isHtmlOrBlank :: Inline -> Bool
664−isHtmlOrBlank (HtmlInline _) = True
665−isHtmlOrBlank (Space) = True
666−isHtmlOrBlank (LineBreak) = True
667−isHtmlOrBlank _ = False
664+isHtmlOrBlank (RawInline "html" _) = True
665+isHtmlOrBlank (Space) = True
666+isHtmlOrBlank (LineBreak) = True
667+isHtmlOrBlank _ = False
668668
669669para :: GenParser Char ParserState Block
670670para = try $ do
@@ -693,7 +693,7 @@ htmlBlock = try $ do
693693 first <- htmlElement
694694 finalSpace <- many spaceChar
695695 finalNewlines <- many newline
696− return $ RawHtml $ first ++ finalSpace ++ finalNewlines
696+ return $ RawBlock "html" $ first ++ finalSpace ++ finalNewlines
697697
698698strictHtmlBlock :: GenParser Char ParserState [Char]
699699strictHtmlBlock = do
@@ -713,7 +713,7 @@ rawTeXBlock = do
713713 failIfStrict
714714 result <- rawLaTeXEnvironment' <|> rawConTeXtEnvironment'
715715 spaces
716− return $ Para [TeX result]
716+ return $ RawBlock "latex" result
717717
718718rawHtmlBlocks :: GenParser Char ParserState Block
719719rawHtmlBlocks = do
@@ -730,7 +730,7 @@ rawHtmlBlocks = do
730730 return $ blk ++ sps
731731 let combined = concat htmlBlocks
732732 let combined' = if last combined == '\n' then init combined else combined
733− return $ RawHtml combined'
733+ return $ RawBlock "html" combined'
734734
735735--
736736-- Tables
@@ -1186,8 +1186,8 @@ inlineNote = try $ do
11861186rawLaTeXInline' :: GenParser Char ParserState Inline
11871187rawLaTeXInline' = do
11881188 failIfStrict
1189− (rawConTeXtEnvironment' >>= return . TeX)
1190− <|> (rawLaTeXEnvironment' >>= return . TeX)
1189+ (rawConTeXtEnvironment' >>= return . RawInline "latex")
1190+ <|> (rawLaTeXEnvironment' >>= return . RawInline "latex")
11911191 <|> rawLaTeXInline
11921192
11931193rawConTeXtEnvironment' :: GenParser Char st String
@@ -1212,7 +1212,7 @@ rawHtmlInline = do
12121212 (_,result) <- if stateStrict st
12131213 then htmlTag (not . isTextTag)
12141214 else htmlTag isInlineTag
1215− return $ HtmlInline result
1215+ return $ RawInline "html" result
12161216
12171217-- Citations
12181218
src/Text/Pandoc/Readers/RST.hs+5−3
@@ -373,8 +373,10 @@ birdTrackLine = do
373373--
374374
375375rawHtmlBlock :: GenParser Char st Block
376−rawHtmlBlock = try $ string ".. raw:: html" >> blanklines >>
377− indentedBlock >>= return . RawHtml
376+rawHtmlBlock = try $ do
377+ string ".. raw:: html"
378+ blanklines
379+ indentedBlock >>= return . RawBlock "html"
378380
379381--
380382-- raw latex
@@ -385,7 +387,7 @@ rawLaTeXBlock = try $ do
385387 string ".. raw:: latex"
386388 blanklines
387389 result <- indentedBlock
388− return $ Para [(TeX result)]
390+ return $ RawBlock "latex" result
389391
390392--
391393-- block quotes
src/Text/Pandoc/Readers/Textile.hs+3−2
@@ -281,7 +281,7 @@ rawHtmlBlock :: GenParser Char ParserState Block
281281rawHtmlBlock = try $ do
282282 (_,b) <- htmlTag isBlockTag
283283 optional blanklines
284− return $ RawHtml b
284+ return $ RawBlock "html" b
285285
286286-- | In textile, paragraphs are separated by blank lines.
287287para :: GenParser Char ParserState Block
@@ -457,7 +457,8 @@ endline = try $ do
457457 return LineBreak
458458
459459rawHtmlInline :: GenParser Char ParserState Inline
460−rawHtmlInline = liftM (HtmlInline . snd) $ htmlTag isInlineTag
460+rawHtmlInline = liftM (RawInline "html" . snd)
461+ $ htmlTag isInlineTag
461462
462463-- | Textile standard link syntax is "label":target
463464link :: GenParser Char ParserState Inline
src/Text/Pandoc/Shared.hs+4−7
@@ -267,7 +267,7 @@ removeEmptyBlocks (Null : xs) = removeEmptyBlocks xs
267267removeEmptyBlocks (BulletList [] : xs) = removeEmptyBlocks xs
268268removeEmptyBlocks (OrderedList _ [] : xs) = removeEmptyBlocks xs
269269removeEmptyBlocks (DefinitionList [] : xs) = removeEmptyBlocks xs
270−removeEmptyBlocks (RawHtml [] : xs) = removeEmptyBlocks xs
270+removeEmptyBlocks (RawBlock _ [] : xs) = removeEmptyBlocks xs
271271removeEmptyBlocks (x:xs) = x : removeEmptyBlocks xs
272272removeEmptyBlocks [] = []
273273
@@ -278,8 +278,7 @@ removeEmptyInlines (Subscript [] : zs) = removeEmptyInlines zs
278278removeEmptyInlines (Superscript [] : zs) = removeEmptyInlines zs
279279removeEmptyInlines (SmallCaps [] : zs) = removeEmptyInlines zs
280280removeEmptyInlines (Strikeout [] : zs) = removeEmptyInlines zs
281−removeEmptyInlines (TeX [] : zs) = removeEmptyInlines zs
282−removeEmptyInlines (HtmlInline [] : zs) = removeEmptyInlines zs
281+removeEmptyInlines (RawInline _ [] : zs) = removeEmptyInlines zs
283282removeEmptyInlines (Code [] : zs) = removeEmptyInlines zs
284283removeEmptyInlines (x : xs) = x : removeEmptyInlines xs
285284removeEmptyInlines [] = []
@@ -311,10 +310,8 @@ consolidateInlines (SmallCaps xs : SmallCaps ys : zs) = consolidateInlines $
311310 SmallCaps (xs ++ ys) : zs
312311consolidateInlines (Strikeout xs : Strikeout ys : zs) = consolidateInlines $
313312 Strikeout (xs ++ ys) : zs
314−consolidateInlines (TeX x : TeX y : zs) = consolidateInlines $
315− TeX (x ++ y) : zs
316−consolidateInlines (HtmlInline x : HtmlInline y : zs) = consolidateInlines $
317− HtmlInline (x ++ y) : zs
313+consolidateInlines (RawInline f x : RawInline f' y : zs) | f == f' =
314+ consolidateInlines $ RawInline f (x ++ y) : zs
318315consolidateInlines (Code x : Code y : zs) = consolidateInlines $
319316 Code (x ++ y) : zs
320317consolidateInlines (x : xs) = x : consolidateInlines xs
src/Text/Pandoc/Writers/ConTeXt.hs+8−3
@@ -124,7 +124,10 @@ blockToConTeXt (BlockQuote lst) = do
124124blockToConTeXt (CodeBlock _ str) =
125125 return $ "\\starttyping" <> cr <> flush (text str) <> cr <> "\\stoptyping" $$ blankline
126126 -- blankline because \stoptyping can't have anything after it, inc. '}'
127−blockToConTeXt (RawHtml _) = return empty
127+blockToConTeXt (RawBlock "context" str) = return $ text str
128+-- for backwards compatibility, allow latex too:
129+blockToConTeXt (RawBlock "latex" str) = return $ text str
130+blockToConTeXt (RawBlock _ _ ) = return empty
128131blockToConTeXt (BulletList lst) = do
129132 contents <- mapM listItemToConTeXt lst
130133 return $ "\\startitemize" $$ vcat contents $$ text "\\stopitemize" <> blankline
@@ -264,8 +267,10 @@ inlineToConTeXt (Math InlineMath str) =
264267 return $ char '$' <> text str <> char '$'
265268inlineToConTeXt (Math DisplayMath str) =
266269 return $ text "\\startformula " <> text str <> text " \\stopformula"
267−inlineToConTeXt (TeX str) = return $ text str
268−inlineToConTeXt (HtmlInline _) = return empty
270+inlineToConTeXt (RawInline "context" str) = return $ text str
271+-- backwards compatibility, allow latex too
272+inlineToConTeXt (RawInline "latex" str) = return $ text str
273+inlineToConTeXt (RawInline _ _) = return empty
269274inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
270275inlineToConTeXt Space = return space
271276inlineToConTeXt (Link [Code str] (src, tit)) = -- since ConTeXt has its own
src/Text/Pandoc/Writers/Docbook.hs+5−3
@@ -179,7 +179,10 @@ blockToDocbook opts (OrderedList (start, numstyle, _) (first:rest)) =
179179 in inTags True "orderedlist" attribs items
180180blockToDocbook opts (DefinitionList lst) =
181181 inTagsIndented "variablelist" $ deflistItemsToDocbook opts lst
182−blockToDocbook _ (RawHtml str) = text str -- raw XML block
182+blockToDocbook _ (RawBlock "docbook" str) = text str -- raw XML block
183+-- we allow html for compatibility with earlier versions of pandoc
184+blockToDocbook _ (RawBlock "html" str) = text str -- raw XML block
185+blockToDocbook _ (RawBlock _ _) = empty
183186blockToDocbook _ HorizontalRule = empty -- not semantic
184187blockToDocbook opts (Table caption aligns widths headers rows) =
185188 let alignStrings = map alignmentToString aligns
@@ -258,8 +261,7 @@ inlineToDocbook _ EnDash = text "–"
258261inlineToDocbook _ (Code str) =
259262 inTagsSimple "literal" $ text (escapeStringForXML str)
260263inlineToDocbook opts (Math _ str) = inlinesToDocbook opts $ readTeXMath str
261−inlineToDocbook _ (TeX _) = empty
262−inlineToDocbook _ (HtmlInline _) = empty
264+inlineToDocbook _ (RawInline _ _) = empty
263265inlineToDocbook _ LineBreak = inTagsSimple "literallayout" empty
264266inlineToDocbook _ Space = space
265267inlineToDocbook opts (Link txt (src, _)) =
src/Text/Pandoc/Writers/EPUB.hs+3−3
@@ -233,13 +233,13 @@ transformInlines (MathML _) _ _ (x@(Math _ _) : xs) = do
233233 mathml ++ "</ops:case><ops:default>" ++ fallback ++ "</ops:default>" ++
234234 "</ops:switch>"
235235 result = if "<math" `isPrefixOf` mathml then inOps else mathml
236− return $ HtmlInline result : xs
237−transformInlines _ _ _ (HtmlInline _ : xs) = return $ Str "" : xs
236+ return $ RawInline "html" result : xs
237+transformInlines _ _ _ (RawInline _ _ : xs) = return $ Str "" : xs
238238transformInlines _ _ _ (Link lab (_,_) : xs) = return $ lab ++ xs
239239transformInlines _ _ _ xs = return xs
240240
241241transformBlock :: Block -> Block
242−transformBlock (RawHtml _) = Null
242+transformBlock (RawBlock _ _) = Null
243243transformBlock x = x
244244
245245(!) :: Node t => (t -> Element) -> [(String, String)] -> t -> Element
src/Text/Pandoc/Writers/HTML.hs+11−9
@@ -105,8 +105,8 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
105105 toc <- if writerTableOfContents opts
106106 then tableOfContents opts sects
107107 else return Nothing
108− let startSlide = RawHtml "<div class=\"slide\">\n"
109− endSlide = RawHtml "</div>\n"
108+ let startSlide = RawBlock "html" "<div class=\"slide\">\n"
109+ endSlide = RawBlock "html" "</div>\n"
110110 let cutUp (HorizontalRule : Header 1 ys : xs) = cutUp (Header 1 ys : xs)
111111 cutUp (HorizontalRule : xs) = [endSlide, startSlide] ++ cutUp xs
112112 cutUp (Header 1 ys : xs) = [endSlide, startSlide] ++
@@ -311,7 +311,8 @@ blockToHtml opts (Para [Image txt (s,tit)]) = do
311311 else thediv ! [theclass "figure"] <<
312312 [img, paragraph ! [theclass "caption"] << capt]
313313blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
314−blockToHtml _ (RawHtml str) = return $ primHtml str
314+blockToHtml _ (RawBlock "html" str) = return $ primHtml str
315+blockToHtml _ (RawBlock _ _) = return noHtml
315316blockToHtml _ (HorizontalRule) = return $ hr
316317blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
317318 let classes' = if writerLiterateHaskell opts
@@ -540,11 +541,12 @@ inlineToHtml opts inline =
540541 return $ case t of
541542 InlineMath -> m
542543 DisplayMath -> br +++ m +++ br )
543− (TeX str) -> case writerHTMLMathMethod opts of
544− LaTeXMathML _ -> do modify (\st -> st {stMath = True})
545− return $ primHtml str
546− _ -> return noHtml
547− (HtmlInline str) -> return $ primHtml str
544+ (RawInline "latex" str) -> case writerHTMLMathMethod opts of
545+ LaTeXMathML _ -> do modify (\st -> st {stMath = True})
546+ return $ primHtml str
547+ _ -> return noHtml
548+ (RawInline "html" str) -> return $ primHtml str
549+ (RawInline _ _) -> return noHtml
548550 (Link [Code str] (s,_)) | "mailto:" `isPrefixOf` s ->
549551 return $ obfuscateLink opts str s
550552 (Link txt (s,_)) | "mailto:" `isPrefixOf` s -> do
@@ -585,7 +587,7 @@ blockListToNote :: WriterOptions -> String -> [Block] -> State WriterState Html
585587blockListToNote opts ref blocks =
586588 -- If last block is Para or Plain, include the backlink at the end of
587589 -- that block. Otherwise, insert a new Plain block with the backlink.
588− let backlink = [HtmlInline $ " <a href=\"#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref ++
590+ let backlink = [RawInline "html" $ " <a href=\"#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref ++
589591 "\" class=\"footnoteBackLink\"" ++
590592 " title=\"Jump back to footnote " ++ ref ++ "\">↩</a>"]
591593 blocks' = if null blocks
src/Text/Pandoc/Writers/LaTeX.hs+5−4
@@ -151,7 +151,7 @@ inCmd cmd contents = char '\\' <> text cmd <> braces contents
151151deVerb :: [Inline] -> [Inline]
152152deVerb [] = []
153153deVerb ((Code str):rest) =
154− (TeX $ "\\texttt{" ++ stringToLaTeX str ++ "}"):(deVerb rest)
154+ (RawInline "latex" $ "\\texttt{" ++ stringToLaTeX str ++ "}"):(deVerb rest)
155155deVerb (other:rest) = other:(deVerb rest)
156156
157157-- | Convert Pandoc block element to LaTeX.
@@ -184,7 +184,8 @@ blockToLaTeX (CodeBlock (_,classes,_) str) = do
184184 else return "verbatim"
185185 return $ "\\begin{" <> text env <> "}" $$ flush (text str) $$
186186 "\\end{" <> text env <> "}" $$ cr -- final cr needed because of footnotes
187−blockToLaTeX (RawHtml _) = return empty
187+blockToLaTeX (RawBlock "latex" x) = return $ text x
188+blockToLaTeX (RawBlock _ _) = return empty
188189blockToLaTeX (BulletList lst) = do
189190 items <- mapM listItemToLaTeX lst
190191 return $ "\\begin{itemize}" $$ vcat items $$ "\\end{itemize}"
@@ -360,8 +361,8 @@ inlineToLaTeX Ellipses = return "\\ldots{}"
360361inlineToLaTeX (Str str) = return $ text $ stringToLaTeX str
361362inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$'
362363inlineToLaTeX (Math DisplayMath str) = return $ "\\[" <> text str <> "\\]"
363−inlineToLaTeX (TeX str) = return $ text str
364−inlineToLaTeX (HtmlInline _) = return empty
364+inlineToLaTeX (RawInline "latex" str) = return $ text str
365+inlineToLaTeX (RawInline _ _) = return empty
365366inlineToLaTeX (LineBreak) = return "\\\\"
366367inlineToLaTeX Space = return space
367368inlineToLaTeX (Link txt (src, _)) =
src/Text/Pandoc/Writers/Man.hs+4−3
@@ -145,7 +145,8 @@ blockToMan opts (Para inlines) = do
145145 contents <- liftM vcat $ mapM (inlineListToMan opts) $
146146 splitSentences inlines
147147 return $ text ".PP" $$ contents
148−blockToMan _ (RawHtml _) = return empty
148+blockToMan _ (RawBlock "man" str) = return $ text str
149+blockToMan _ (RawBlock _ _) = return empty
149150blockToMan _ HorizontalRule = return $ text ".PP" $$ text " * * * * *"
150151blockToMan opts (Header level inlines) = do
151152 contents <- inlineListToMan opts inlines
@@ -313,8 +314,8 @@ inlineToMan opts (Math InlineMath str) = inlineListToMan opts $ readTeXMath str
313314inlineToMan opts (Math DisplayMath str) = do
314315 contents <- inlineListToMan opts $ readTeXMath str
315316 return $ cr <> text ".RS" $$ contents $$ text ".RE"
316−inlineToMan _ (TeX _) = return empty
317−inlineToMan _ (HtmlInline _) = return empty
317+inlineToMan _ (RawInline "man" str) = return $ text str
318+inlineToMan _ (RawInline _ _) = return empty
318319inlineToMan _ (LineBreak) = return $
319320 cr <> text ".PD 0" $$ text ".P" $$ text ".PD" <> cr
320321inlineToMan _ Space = return space
src/Text/Pandoc/Writers/Markdown.hs+11−9
@@ -75,8 +75,7 @@ plainify = bottomUp go
7575 go (SmallCaps xs) = SmallCaps xs
7676 go (Code s) = Str s
7777 go (Math _ s) = Str s
78− go (TeX _) = Str ""
79− go (HtmlInline _) = Str ""
78+ go (RawInline _ _) = Str ""
8079 go (Link xs _) = SmallCaps xs
8180 go (Image xs _) = SmallCaps $ [Str "["] ++ xs ++ [Str "]"]
8281 go (Cite _ cits) = SmallCaps cits
@@ -206,11 +205,13 @@ blockToMarkdown opts (Para inlines) = do
206205 then text "\\"
207206 else empty
208207 return $ esc <> contents <> blankline
209−blockToMarkdown _ (RawHtml str) = do
210− st <- get
211− if stPlain st
212− then return empty
213− else return $ text str <> text "\n"
208+blockToMarkdown _ (RawBlock f str)
209+ | f == "html" || f == "latex" || f == "markdown" = do
210+ st <- get
211+ if stPlain st
212+ then return empty
213+ else return $ text str <> text "\n"
214+blockToMarkdown _ (RawBlock _ _) = return empty
214215blockToMarkdown _ HorizontalRule =
215216 return $ blankline <> text "* * * * *" <> blankline
216217blockToMarkdown opts (Header level inlines) = do
@@ -439,8 +440,9 @@ inlineToMarkdown _ (Math InlineMath str) =
439440 return $ "$" <> text str <> "$"
440441inlineToMarkdown _ (Math DisplayMath str) =
441442 return $ "$$" <> text str <> "$$"
442−inlineToMarkdown _ (TeX str) = return $ text str
443−inlineToMarkdown _ (HtmlInline str) = return $ text str
443+inlineToMarkdown _ (RawInline f str)
444+ | f == "html" || f == "latex" || f == "markdown" = return $ text str
445+inlineToMarkdown _ (RawInline _ _) = return empty
444446inlineToMarkdown opts (LineBreak) = return $
445447 if writerStrictMarkdown opts
446448 then " " <> cr
src/Text/Pandoc/Writers/MediaWiki.hs+6−4
@@ -96,7 +96,9 @@ blockToMediaWiki opts (Para inlines) = do
9696 then "<p>" ++ contents ++ "</p>"
9797 else contents ++ if null listLevel then "\n" else ""
9898
99−blockToMediaWiki _ (RawHtml str) = return str
99+blockToMediaWiki _ (RawBlock "mediawiki" str) = return str
100+blockToMediaWiki _ (RawBlock "html" str) = return str
101+blockToMediaWiki _ (RawBlock _ _) = return ""
100102
101103blockToMediaWiki _ HorizontalRule = return "\n-----\n"
102104
@@ -368,9 +370,9 @@ inlineToMediaWiki _ (Str str) = return $ escapeString str
368370inlineToMediaWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
369371 -- note: str should NOT be escaped
370372
371−inlineToMediaWiki _ (TeX _) = return ""
372−
373−inlineToMediaWiki _ (HtmlInline str) = return str
373+inlineToMediaWiki _ (RawInline "mediawiki" str) = return str
374+inlineToMediaWiki _ (RawInline "html" str) = return str
375+inlineToMediaWiki _ (RawInline _ _) = return ""
374376
375377inlineToMediaWiki _ (LineBreak) = return "<br />\n"
376378
src/Text/Pandoc/Writers/OpenDocument.hs+4−3
@@ -279,7 +279,7 @@ blockToOpenDocument o bs
279279 | Header i b <- bs = inHeaderTags i <$> inlinesToOpenDocument o b
280280 | BlockQuote b <- bs = mkBlockQuote b
281281 | CodeBlock _ s <- bs = preformatted s
282− | RawHtml _ <- bs = return empty
282+ | RawBlock _ _ <- bs = return empty
283283 | DefinitionList b <- bs = defList b
284284 | BulletList b <- bs = bulletListToOpenDocument o b
285285 | OrderedList a b <- bs = orderedList a b
@@ -365,8 +365,9 @@ inlineToOpenDocument o ils
365365 | Code s <- ils = preformatted s
366366 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
367367 | Cite _ l <- ils = inlinesToOpenDocument o l
368− | TeX _ <- ils = return empty
369− | HtmlInline s <- ils = preformatted s
368+ | RawInline "opendocument" s <- ils = preformatted s
369+ | RawInline "html" s <- ils = preformatted s -- for backwards compat.
370+ | RawInline _ _ <- ils = return empty
370371 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
371372 | Image _ (s,_) <- ils = return $ mkImg s
372373 | Note l <- ils = mkNote l
src/Text/Pandoc/Writers/Org.hs+6−3
@@ -115,9 +115,12 @@ blockToOrg (Para [Image txt (src,tit)]) = do
115115blockToOrg (Para inlines) = do
116116 contents <- inlineListToOrg inlines
117117 return $ contents <> blankline
118−blockToOrg (RawHtml str) =
118+blockToOrg (RawBlock "html" str) =
119119 return $ blankline $$ "#+BEGIN_HTML" $$
120120 nest 2 (text str) $$ "#+END_HTML" $$ blankline
121+blockToOrg (RawBlock "latex" str) = return $ text str
122+blockToOrg (RawBlock "org" str) = return $ text str
123+blockToOrg (RawBlock _ _) = return empty
121124blockToOrg HorizontalRule = return $ blankline $$ "--------------" $$ blankline
122125blockToOrg (Header level inlines) = do
123126 contents <- inlineListToOrg inlines
@@ -257,8 +260,8 @@ inlineToOrg (Math t str) = do
257260 return $ if t == InlineMath
258261 then "$" <> text str <> "$"
259262 else "$$" <> text str <> "$$"
260−inlineToOrg (TeX str) = return $ text str
261−inlineToOrg (HtmlInline _) = return empty
263+inlineToOrg (RawInline "latex" str) = return $ text str
264+inlineToOrg (RawInline _ _) = return empty
262265inlineToOrg (LineBreak) = return cr -- there's no line break in Org
263266inlineToOrg Space = return space
264267inlineToOrg (Link txt (src, _)) = do
src/Text/Pandoc/Writers/RST.hs+3−4
@@ -148,8 +148,8 @@ blockToRST (Para [Image txt (src,tit)]) = do
148148blockToRST (Para inlines) = do
149149 contents <- inlineListToRST inlines
150150 return $ contents <> blankline
151−blockToRST (RawHtml str) =
152− return $ blankline <> ".. raw:: html" $+$
151+blockToRST (RawBlock f str) =
152+ return $ blankline <> ".. raw:: " <> text f $+$
153153 (nest 3 $ text str) $$ blankline
154154blockToRST HorizontalRule =
155155 return $ blankline $$ "--------------" $$ blankline
@@ -292,8 +292,7 @@ inlineToRST (Math t str) = do
292292 return $ if t == InlineMath
293293 then ":math:`$" <> text str <> "$`"
294294 else ":math:`$$" <> text str <> "$$`"
295−inlineToRST (TeX _) = return empty
296−inlineToRST (HtmlInline _) = return empty
295+inlineToRST (RawInline _ _) = return empty
297296inlineToRST (LineBreak) = return cr -- there's no line break in RST
298297inlineToRST Space = return space
299298inlineToRST (Link [Code str] (src, _)) | src == str ||
src/Text/Pandoc/Writers/RTF.hs+4−3
@@ -159,7 +159,8 @@ blockToRTF indent alignment (BlockQuote lst) =
159159 concatMap (blockToRTF (indent + indentIncrement) alignment) lst
160160blockToRTF indent _ (CodeBlock _ str) =
161161 rtfPar indent 0 AlignLeft ("\\f1 " ++ (codeStringToRTF str))
162−blockToRTF _ _ (RawHtml _) = ""
162+blockToRTF _ _ (RawBlock "rtf" str) = str
163+blockToRTF _ _ (RawBlock _ _) = ""
163164blockToRTF indent alignment (BulletList lst) = spaceAtEnd $
164165 concatMap (listItemToRTF alignment indent (bulletMarker indent)) lst
165166blockToRTF indent alignment (OrderedList attribs lst) = spaceAtEnd $ concat $
@@ -268,8 +269,8 @@ inlineToRTF (Code str) = "{\\f1 " ++ (codeStringToRTF str) ++ "}"
268269inlineToRTF (Str str) = stringToRTF str
269270inlineToRTF (Math _ str) = inlineListToRTF $ readTeXMath str
270271inlineToRTF (Cite _ lst) = inlineListToRTF lst
271−inlineToRTF (TeX _) = ""
272−inlineToRTF (HtmlInline _) = ""
272+inlineToRTF (RawInline "rtf" str) = str
273+inlineToRTF (RawInline _ _) = ""
273274inlineToRTF (LineBreak) = "\\line "
274275inlineToRTF Space = " "
275276inlineToRTF (Link text (src, _)) =
src/Text/Pandoc/Writers/Texinfo.hs+8−3
@@ -129,7 +129,10 @@ blockToTexinfo (CodeBlock _ str) = do
129129 flush (text str) $$
130130 text "@end verbatim" <> blankline
131131
132−blockToTexinfo (RawHtml _) = return empty
132+blockToTexinfo (RawBlock "texinfo" str) = return $ text str
133+blockToTexinfo (RawBlock "latex" str) =
134+ return $ text "@tex" $$ text str $$ text "@end tex"
135+blockToTexinfo (RawBlock _ _) = return empty
133136
134137blockToTexinfo (BulletList lst) = do
135138 items <- mapM listItemToTexinfo lst
@@ -388,8 +391,10 @@ inlineToTexinfo EnDash = return $ text "--"
388391inlineToTexinfo Ellipses = return $ text "@dots{}"
389392inlineToTexinfo (Str str) = return $ text (stringToTexinfo str)
390393inlineToTexinfo (Math _ str) = return $ inCmd "math" $ text str
391−inlineToTexinfo (TeX str) = return $ text "@tex" $$ text str $$ text "@end tex"
392−inlineToTexinfo (HtmlInline _) = return empty
394+inlineToTexinfo (RawInline "latex" str) =
395+ return $ text "@tex" $$ text str $$ text "@end tex"
396+inlineToTexinfo (RawInline "texinfo" str) = return $ text str
397+inlineToTexinfo (RawInline _ _) = return empty
393398inlineToTexinfo (LineBreak) = return $ text "@*"
394399inlineToTexinfo Space = return $ char ' '
395400
src/Text/Pandoc/Writers/Textile.hs+8−4
@@ -109,7 +109,10 @@ blockToTextile opts (Para inlines) = do
109109 then "<p>" ++ contents ++ "</p>"
110110 else contents ++ if null listLevel then "\n" else ""
111111
112−blockToTextile _ (RawHtml str) = return str
112+blockToTextile _ (RawBlock f str) =
113+ if f == "html" || f == "textile"
114+ then return str
115+ else return ""
113116
114117blockToTextile _ HorizontalRule = return "<hr />\n"
115118
@@ -385,9 +388,10 @@ inlineToTextile _ (Str str) = return $ escapeStringForTextile str
385388inlineToTextile _ (Math _ str) =
386389 return $ "<span class=\"math\">" ++ escapeStringForXML str ++ "</math>"
387390
388−inlineToTextile _ (TeX _) = return ""
389−
390−inlineToTextile _ (HtmlInline str) = return str
391+inlineToTextile _ (RawInline f str) =
392+ if f == "html" || f == "textile"
393+ then return str
394+ else return ""
391395
392396inlineToTextile _ (LineBreak) = return "\n"
393397
tests/Tests/Arbitrary.hs+7−1
@@ -35,6 +35,8 @@ arbInline n = frequency $ [ (60, liftM Str realString)
3535 , (5, return EnDash)
3636 , (5, return Apostrophe)
3737 , (5, return Ellipses)
38+ , (5, elements [ RawInline "html" "<a>*&amp;*</a>"
39+ , RawInline "latex" "\\my{command}" ])
3840 ] ++ [ x | x <- nesters, n > 1]
3941 where nesters = [ (10, liftM Emph $ listOf $ arbInline (n-1))
4042 , (10, liftM Strong $ listOf $ arbInline (n-1))
@@ -66,7 +68,11 @@ arbBlock :: Int -> Gen Block
6668arbBlock n = frequency $ [ (10, liftM Plain arbitrary)
6769 , (15, liftM Para arbitrary)
6870 , (5, liftM2 CodeBlock arbitrary realString)
69− , (2, liftM RawHtml realString)
71+ , (2, elements [ RawBlock "html"
72+ "<div>\n*&amp;*\n</div>"
73+ , RawBlock "latex"
74+ "\\begin[opt]{env}\nhi\n{\\end{env}"
75+ ])
7076 , (5, do x1 <- choose (1 :: Int, 6)
7177 x2 <- arbitrary
7278 return (Header x1 x2))
tests/latex-reader.native+1−1
@@ -259,7 +259,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
259259,Header 1 [Str "LaTeX"]
260260,BulletList
261261 [[Para [Cite [Citation {citationId = "smith.1899", citationPrefix = [], citationSuffix = [Str "22",Str "-",Str "23"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] []]]
262− ,[Para [TeX "\\doublespacing"]]
262+ ,[Para [RawInline "latex" "\\doublespacing"]]
263263 ,[Para [Math InlineMath "2+2=4"]]
264264 ,[Para [Math InlineMath "x \\in y"]]
265265 ,[Para [Math InlineMath "\\alpha \\wedge \\omega"]]
tests/markdown-reader-more.native+4−4
@@ -2,8 +2,8 @@
22,Header 2 [Str "Blank",Space,Str "line",Space,Str "before",Space,Str "URL",Space,Str "in",Space,Str "link",Space,Str "reference"]
33,Para [Link [Str "foo"] ("/url",""),Space,Str "and",Space,Link [Str "bar"] ("/url","title")]
44,Header 2 [Str "Raw",Space,Str "ConTeXt",Space,Str "environments"]
5−,Para [TeX "\\placeformula",Space,TeX "\\startformula\n L_{1} = L_{2}\n \\stopformula"]
6−,Para [TeX "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]"]
5+,Para [RawInline "latex" "\\placeformula",Space,RawInline "latex" "\\startformula\n L_{1} = L_{2}\n \\stopformula"]
6+,RawBlock "latex" "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]"
77,Header 2 [Str "URLs",Space,Str "with",Space,Str "spaces"]
88,Para [Link [Str "foo"] ("/bar%20and%20baz",""),Space,Link [Str "foo"] ("/bar%20and%20baz",""),Space,Link [Str "foo"] ("/bar%20and%20baz",""),Space,Link [Str "foo"] ("bar%20baz","title")]
99,Para [Link [Str "baz"] ("/foo%20foo",""),Space,Link [Str "bam"] ("/foo%20fee",""),Space,Link [Str "bork"] ("/foo/zee%20zob","title")]
@@ -11,13 +11,13 @@
1111,HorizontalRule
1212,HorizontalRule
1313,Header 2 [Str "Raw",Space,Str "HTML",Space,Str "before",Space,Str "header"]
14−,Plain [HtmlInline "<a>",HtmlInline "</a>"]
14+,Plain [RawInline "html" "<a>",RawInline "html" "</a>"]
1515,Header 3 [Str "my",Space,Str "header"]
1616,Header 2 [Str "$",Space,Str "in",Space,Str "math"]
1717,Para [Math InlineMath "\\$2 + \\$3"]
1818,Header 2 [Str "Commented",Str "-",Str "out",Space,Str "list",Space,Str "item"]
1919,BulletList
20− [[Plain [Str "one",Space,HtmlInline "<!--\n- two\n-->"]]
20+ [[Plain [Str "one",Space,RawInline "html" "<!--\n- two\n-->"]]
2121 ,[Plain [Str "three"]]]
2222,Header 2 [Str "Backslash",Space,Str "newline"]
2323,Para [Str "hi",LineBreak,Str "there"]
tests/rst-reader.native+3−3
@@ -174,11 +174,11 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":
174174 [[Plain [Str "123",EnDash,Str "4567"]]])]
175175,Header 1 [Str "HTML",Space,Str "Blocks"]
176176,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line",Str ":"]
177−,RawHtml "<div>foo</div>\n"
177+,RawBlock "html" "<div>foo</div>\n"
178178,Para [Str "Now,",Space,Str "nested",Str ":"]
179−,RawHtml "<div>\n <div>\n <div>\n foo\n </div>\n </div>\n</div>\n"
179+,RawBlock "html" "<div>\n <div>\n <div>\n foo\n </div>\n </div>\n</div>\n"
180180,Header 1 [Str "LaTeX",Space,Str "Block"]
181−,Para [TeX "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}\n"]
181+,RawBlock "latex" "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}\n"
182182,Header 1 [Str "Inline",Space,Str "Markup"]
183183,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ".",Space,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str "."]
184184,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
tests/testsuite.native+18−18
@@ -228,45 +228,45 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
228228 ,[Plain [Str "sublist"]]]]])]
229229,Header 1 [Str "HTML",Space,Str "Blocks"]
230230,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line",Str ":"]
231−,RawHtml "<div>"
231+,RawBlock "html" "<div>"
232232,Plain [Str "foo"]
233−,RawHtml "</div>\n"
233+,RawBlock "html" "</div>\n"
234234,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation",Str ":"]
235−,RawHtml "<div>\n<div>\n<div>"
235+,RawBlock "html" "<div>\n<div>\n<div>"
236236,Plain [Str "foo"]
237−,RawHtml "</div>\n</div>\n<div>"
237+,RawBlock "html" "</div>\n</div>\n<div>"
238238,Plain [Str "bar"]
239−,RawHtml "</div>\n</div>\n"
239+,RawBlock "html" "</div>\n</div>\n"
240240,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table",Str ":"]
241−,RawHtml "<table>\n<tr>\n<td>"
241+,RawBlock "html" "<table>\n<tr>\n<td>"
242242,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
243−,RawHtml "</td>\n<td>"
243+,RawBlock "html" "</td>\n<td>"
244244,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
245−,RawHtml "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
245+,RawBlock "html" "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
246246,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "simple",Space,Str "block",Str ":"]
247−,RawHtml "<div>\n "
247+,RawBlock "html" "<div>\n "
248248,Plain [Str "foo"]
249−,RawHtml "</div>\n"
249+,RawBlock "html" "</div>\n"
250250,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block",Str ",",Space,Str "though",Str ":"]
251251,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
252252,Para [Str "As",Space,Str "should",Space,Str "this",Str ":"]
253253,CodeBlock ("",[],[]) "<div>foo</div>"
254254,Para [Str "Now",Str ",",Space,Str "nested",Str ":"]
255−,RawHtml "<div>\n <div>\n <div>\n "
255+,RawBlock "html" "<div>\n <div>\n <div>\n "
256256,Plain [Str "foo"]
257−,RawHtml "</div>\n </div>\n</div>\n"
257+,RawBlock "html" "</div>\n </div>\n</div>\n"
258258,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment",Str ":"]
259−,RawHtml "<!-- Comment -->\n"
259+,RawBlock "html" "<!-- Comment -->\n"
260260,Para [Str "Multiline",Str ":"]
261−,RawHtml "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
261+,RawBlock "html" "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
262262,Para [Str "Code",Space,Str "block",Str ":"]
263263,CodeBlock ("",[],[]) "<!-- Comment -->"
264264,Para [Str "Just",Space,Str "plain",Space,Str "comment",Str ",",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line",Str ":"]
265−,RawHtml "<!-- foo --> \n"
265+,RawBlock "html" "<!-- foo --> \n"
266266,Para [Str "Code",Str ":"]
267267,CodeBlock ("",[],[]) "<hr />"
268268,Para [Str "Hr",Apostrophe,Str "s",Str ":"]
269−,RawHtml "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
269+,RawBlock "html" "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
270270,HorizontalRule
271271,Header 1 [Str "Inline",Space,Str "Markup"]
272272,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
@@ -294,7 +294,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
294294,HorizontalRule
295295,Header 1 [Str "LaTeX"]
296296,BulletList
297− [[Plain [TeX "\\cite[22-23]{smith.1899}"]]
297+ [[Plain [RawInline "latex" "\\cite[22-23]{smith.1899}"]]
298298 ,[Plain [Math InlineMath "2+2=4"]]
299299 ,[Plain [Math InlineMath "x \\in y"]]
300300 ,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]]
@@ -309,7 +309,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
309309 ,[Plain [Str "Shoes",Space,Str "(",Str "$",Str "20",Str ")",Space,Str "and",Space,Str "socks",Space,Str "(",Str "$",Str "5",Str ")",Str "."]]
310310 ,[Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
311311,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table",Str ":"]
312−,Para [TeX "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"]
312+,RawBlock "latex" "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
313313,HorizontalRule
314314,Header 1 [Str "Special",Space,Str "Characters"]
315315,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode",Str ":"]
tests/textile-reader.native+6−6
@@ -125,18 +125,18 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
125125 ,[Plain [Str "24"]]
126126 ,[Plain [Str "f"]]]]
127127,Header 1 [Str "Raw",Space,Str "HTML"]
128−,Para [Str "However",Str ",",Space,HtmlInline "<strong>",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,HtmlInline "</strong>",Space,Str "are",Space,Str "accepted",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
129−,RawHtml "<div class=\"foobar\">"
128+,Para [Str "However",Str ",",Space,RawInline "html" "<strong>",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,RawInline "html" "</strong>",Space,Str "are",Space,Str "accepted",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
129+,RawBlock "html" "<div class=\"foobar\">"
130130,Para [Str "any",Space,Strong [Str "Raw",Space,Str "HTML",Space,Str "Block"],Space,Str "with",Space,Str "bold",LineBreak]
131−,RawHtml "</div>"
131+,RawBlock "html" "</div>"
132132,Para [Str "Html",Space,Str "blocks",Space,Str "can",Space,Str "be"]
133−,RawHtml "<div>"
133+,RawBlock "html" "<div>"
134134,Para [Str "inlined"]
135−,RawHtml "</div>"
135+,RawBlock "html" "</div>"
136136,Para [Str "as",Space,Str "well",Str "."]
137137,BulletList
138138 [[Plain [Str "this",Space,Str "<",Str "div",Str ">",Space,Str "won",Apostrophe,Str "t",Space,Str "produce",Space,Str "raw",Space,Str "html",Space,Str "blocks",Space,Str "<",Str "/div",Str ">"]]
139− ,[Plain [Str "but",Space,Str "this",Space,HtmlInline "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,HtmlInline "</strong>"]]]
139+ ,[Plain [Str "but",Space,Str "this",Space,RawInline "html" "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,RawInline "html" "</strong>"]]]
140140,Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"]
141141,Header 1 [Str "Acronyms",Space,Str "and",Space,Str "marks"]
142142,Para [Str "PBS",Space,Str "(",Str "Public",Space,Str "Broadcasting",Space,Str "System",Str ")"]
tests/writer.context−1
@@ -696,7 +696,6 @@ Animal & Number \\ \hline
696696Dog & 2 \\
697697Cat & 1 \\ \hline
698698\end{tabular}
699−
700699\thinrule
701700
702701\subject{Special Characters}
tests/writer.docbook−2
@@ -1133,8 +1133,6 @@ These should not be escaped: \$ \\ \&gt; \[ \{
11331133 <para>
11341134 Here's a LaTeX table:
11351135 </para>
1136− <para>
1137− </para>
11381136</section>
11391137<section id="special-characters">
11401138 <title>Special Characters</title>
tests/writer.html−2
@@ -846,8 +846,6 @@ Blah
846846 ></ul
847847><p
848848>Here’s a LaTeX table:</p
849−><p
850−></p
851849><hr
852850 /><h1 id="special-characters"
853851>Special Characters</h1
tests/writer.latex−1
@@ -634,7 +634,6 @@ Animal & Number \\ \hline
634634Dog & 2 \\
635635Cat & 1 \\ \hline
636636\end{tabular}
637−
638637\begin{center}\rule{3in}{0.4pt}\end{center}
639638
640639\section{Special Characters}
tests/writer.man−1
@@ -590,7 +590,6 @@ Shoes ($20) and socks ($5).
590590Escaped \f[C]$\f[]: $73 \f[I]this should be emphasized\f[] 23$.
591591.PP
592592Here's a LaTeX table:
593−.PP
594593.PP
595594 * * * * *
596595.SH Special Characters
tests/writer.mediawiki−1
@@ -496,7 +496,6 @@ Here&rsquo;s a LaTeX table:
496496
497497
498498
499−
500499-----
501500
502501= Special Characters =
tests/writer.native+18−18
@@ -228,45 +228,45 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
228228 ,[Plain [Str "sublist"]]]]])]
229229,Header 1 [Str "HTML",Space,Str "Blocks"]
230230,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line",Str ":"]
231−,RawHtml "<div>"
231+,RawBlock "html" "<div>"
232232,Plain [Str "foo"]
233−,RawHtml "</div>\n"
233+,RawBlock "html" "</div>\n"
234234,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation",Str ":"]
235−,RawHtml "<div>\n<div>\n<div>"
235+,RawBlock "html" "<div>\n<div>\n<div>"
236236,Plain [Str "foo"]
237−,RawHtml "</div>\n</div>\n<div>"
237+,RawBlock "html" "</div>\n</div>\n<div>"
238238,Plain [Str "bar"]
239−,RawHtml "</div>\n</div>\n"
239+,RawBlock "html" "</div>\n</div>\n"
240240,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table",Str ":"]
241−,RawHtml "<table>\n<tr>\n<td>"
241+,RawBlock "html" "<table>\n<tr>\n<td>"
242242,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
243−,RawHtml "</td>\n<td>"
243+,RawBlock "html" "</td>\n<td>"
244244,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
245−,RawHtml "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
245+,RawBlock "html" "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
246246,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "simple",Space,Str "block",Str ":"]
247−,RawHtml "<div>\n "
247+,RawBlock "html" "<div>\n "
248248,Plain [Str "foo"]
249−,RawHtml "</div>\n"
249+,RawBlock "html" "</div>\n"
250250,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block",Str ",",Space,Str "though",Str ":"]
251251,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
252252,Para [Str "As",Space,Str "should",Space,Str "this",Str ":"]
253253,CodeBlock ("",[],[]) "<div>foo</div>"
254254,Para [Str "Now",Str ",",Space,Str "nested",Str ":"]
255−,RawHtml "<div>\n <div>\n <div>\n "
255+,RawBlock "html" "<div>\n <div>\n <div>\n "
256256,Plain [Str "foo"]
257−,RawHtml "</div>\n </div>\n</div>\n"
257+,RawBlock "html" "</div>\n </div>\n</div>\n"
258258,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment",Str ":"]
259−,RawHtml "<!-- Comment -->\n"
259+,RawBlock "html" "<!-- Comment -->\n"
260260,Para [Str "Multiline",Str ":"]
261−,RawHtml "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
261+,RawBlock "html" "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
262262,Para [Str "Code",Space,Str "block",Str ":"]
263263,CodeBlock ("",[],[]) "<!-- Comment -->"
264264,Para [Str "Just",Space,Str "plain",Space,Str "comment",Str ",",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line",Str ":"]
265−,RawHtml "<!-- foo --> \n"
265+,RawBlock "html" "<!-- foo --> \n"
266266,Para [Str "Code",Str ":"]
267267,CodeBlock ("",[],[]) "<hr />"
268268,Para [Str "Hr",Apostrophe,Str "s",Str ":"]
269−,RawHtml "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
269+,RawBlock "html" "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
270270,HorizontalRule
271271,Header 1 [Str "Inline",Space,Str "Markup"]
272272,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
@@ -294,7 +294,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
294294,HorizontalRule
295295,Header 1 [Str "LaTeX"]
296296,BulletList
297− [[Plain [TeX "\\cite[22-23]{smith.1899}"]]
297+ [[Plain [RawInline "latex" "\\cite[22-23]{smith.1899}"]]
298298 ,[Plain [Math InlineMath "2+2=4"]]
299299 ,[Plain [Math InlineMath "x \\in y"]]
300300 ,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]]
@@ -309,7 +309,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
309309 ,[Plain [Str "Shoes",Space,Str "(",Str "$",Str "20",Str ")",Space,Str "and",Space,Str "socks",Space,Str "(",Str "$",Str "5",Str ")",Str "."]]
310310 ,[Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
311311,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table",Str ":"]
312−,Para [TeX "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"]
312+,RawBlock "latex" "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
313313,HorizontalRule
314314,Header 1 [Str "Special",Space,Str "Characters"]
315315,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode",Str ":"]
tests/writer.rst+8
@@ -617,6 +617,14 @@ These shouldn’t be math:
617617
618618Here’s a LaTeX table:
619619
620+.. raw:: latex
621+
622+ \begin{tabular}{|l|l|}\hline
623+ Animal & Number \\ \hline
624+ Dog & 2 \\
625+ Cat & 1 \\ \hline
626+ \end{tabular}
627+
620628--------------
621629
622630Special Characters
tests/writer.rtf−1
@@ -277,7 +277,6 @@ quoted link
277277{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Shoes ($20) and socks ($5).\par}
278278{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Escaped {\f1 $}: $73 {\i this should be emphasized} 23$.\sa180\par}
279279{\pard \ql \f0 \sa180 \li0 \fi0 Here\u8217's a LaTeX table:\par}
280−{\pard \ql \f0 \sa180 \li0 \fi0 \par}
281280{\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par}
282281{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Special Characters\par}
283282{\pard \ql \f0 \sa180 \li0 \fi0 Here is some unicode:\par}
tests/writer.texinfo−1
@@ -789,7 +789,6 @@ Dog & 2 \\
789789Cat & 1 \\ \hline
790790\end{tabular}
791791@end tex
792−
793792@iftex
794793@bigskip@hrule@bigskip
795794@end iftex
tests/writer.textile−1
@@ -533,7 +533,6 @@ These shouldn't be math:
533533Here's a LaTeX table:
534534
535535
536−
537536<hr />
538537
539538h1. Special Characters