diff options
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 5 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index f1088b158..56e2b9027 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -452,8 +452,11 @@ inlineToDokuWiki _ (Code _ str) = inlineToDokuWiki _ (Str str) = return $ escapeString str -inlineToDokuWiki _ (Math _ str) = return $ "$" ++ str ++ "$" +inlineToDokuWiki _ (Math mathType str) = return $ delim ++ str ++ delim -- note: str should NOT be escaped + where delim = case mathType of + DisplayMath -> "$$" + InlineMath -> "$" inlineToDokuWiki _ (RawInline f str) | f == Format "dokuwiki" = return str diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index fe1f8296a..79fcdde8a 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -459,7 +459,7 @@ Ellipses…and…and…. * $\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 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: |