From e462f80d74e7d0297ae96dc8bd57cb66dcccfa71 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Feb 2017 22:57:48 +0100 Subject: MediaWiki writer: add display attribute on `` tags. This allows display math to be rendered properly. Closes #3452. --- src/Text/Pandoc/Writers/MediaWiki.hs | 7 +++++-- test/writer.mediawiki | 14 +++++++------- 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 $ "" ++ str ++ "" - -- note: str should NOT be escaped +inlineToMediaWiki (Math mt str) = return $ + "" ++ str ++ "" + -- 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 = * -* 2+2=4 -* x \in y -* \alpha \wedge \omega -* 223 -* p-Tree -* Here’s some display math: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} -* Here’s one that has a line break in it: \alpha + \omega \times x^2. +* 2+2=4 +* x \in y +* \alpha \wedge \omega +* 223 +* p-Tree +* Here’s some display math: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} +* Here’s one that has a line break in it: \alpha + \omega \times x^2. These shouldn’t be math: -- cgit v1.2.3