git.iko.soy/typeable/pandoc
on master help sign in
Mediawiki writer: don't escape inside `<source>`.

Closes #1445. Escapes can still be used with `<code>` and `<pre>`.

commit02c79ea4f6c050e9e610825e8b462382beae2b5a authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 29 Jul 2014, 21:21 (12 years ago) parent33a051d
1 file changed+8−4
src/Text/Pandoc/Writers/MediaWiki.hs+8−4
src/Text/Pandoc/Writers/MediaWiki.hs+8−4
@@ -139,10 +139,14 @@ blockToMediaWiki (CodeBlock (_,classes,_) str) = do
139139 "python", "qbasic", "rails", "reg", "robots", "ruby", "sas", "scheme", "sdlbasic",
140140 "smalltalk", "smarty", "sql", "tcl", "", "thinbasic", "tsql", "vb", "vbnet", "vhdl",
141141 "visualfoxpro", "winbatch", "xml", "xpp", "z80"]
142− let (beg, end) = if null at
143− then ("<pre" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</pre>")
144− else ("<source lang=\"" ++ head at ++ "\">", "</source>")
145− return $ beg ++ escapeString str ++ end
142+ return $
143+ if null at
144+ then "<pre" ++ (if null classes
145+ then ">"
146+ else " class=\"" ++ unwords classes ++ "\">") ++
147+ escapeString str ++ "</pre>"
148+ else "<source lang=\"" ++ head at ++ "\">" ++ str ++ "</source>"
149+ -- note: no escape!
146150
147151blockToMediaWiki (BlockQuote blocks) = do
148152 contents <- blockListToMediaWiki blocks