aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/MediaWiki.hs7
-rw-r--r--test/writer.mediawiki14
2 files changed, 12 insertions, 9 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
diff --git a/test/writer.mediawiki b/test/writer.mediawiki
index 066606c00..71b8e7f3e 100644
--- a/test/writer.mediawiki
+++ b/test/writer.mediawiki
@@ -469,13 +469,13 @@ Ellipses…and…and….
= LaTeX =
*
-* <math>2+2=4</math>
-* <math>x \in y</math>
-* <math>\alpha \wedge \omega</math>
-* <math>223</math>
-* <math>p</math>-Tree
-* Here’s some display math: <math>\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>
-* Here’s one that has a line break in it: <math>\alpha + \omega \times x^2</math>.
+* <math display="inline">2+2=4</math>
+* <math display="inline">x \in y</math>
+* <math display="inline">\alpha \wedge \omega</math>
+* <math display="inline">223</math>
+* <math display="inline">p</math>-Tree
+* Here’s some display math: <math display="block">\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>
+* Here’s one that has a line break in it: <math display="inline">\alpha + \omega \times x^2</math>.
These shouldn’t be math: