aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-21 22:57:48 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-21 22:57:48 +0100
commite462f80d74e7d0297ae96dc8bd57cb66dcccfa71 (patch)
tree2765fd941718b12a6da112f650322419b1b46291 /src/Text
parent5269724ad39dfbbd473ae559aa2fff9ba7e5ee3b (diff)
downloadpandoc-e462f80d74e7d0297ae96dc8bd57cb66dcccfa71.tar.gz
MediaWiki writer: add display attribute on `<math>` tags.
This allows display math to be rendered properly. Closes #3452.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/MediaWiki.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs
index c554812fd..d677cd2d0 100644
--- a/src/Text/Pandoc/Writers/MediaWiki.hs
+++ b/src/Text/Pandoc/Writers/MediaWiki.hs
@@ -388,8 +388,11 @@ inlineToMediaWiki (Code _ str) =
inlineToMediaWiki (Str str) = return $ escapeString str
-inlineToMediaWiki (Math _ str) = return $ "<math>" ++ str ++ "</math>"
- -- note: str should NOT be escaped
+inlineToMediaWiki (Math mt str) = return $
+ "<math display=\"" ++
+ (if mt == DisplayMath then "block" else "inline") ++
+ "\">" ++ str ++ "</math>"
+ -- note: str should NOT be escaped
inlineToMediaWiki (RawInline f str)
| f == Format "mediawiki" = return str