aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-03-08 10:08:14 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-03-08 10:08:14 -0800
commit6bfaa5ad15d2c3acfc61ddf5ec442ca733016373 (patch)
tree91518f7290ca7178f69d044a788802fdf3954dd0
parent0b9c54d9f31db88d5cd8e888921dffc2a108f8d4 (diff)
downloadpandoc-6bfaa5ad15d2c3acfc61ddf5ec442ca733016373.tar.gz
DokuWiki writer: use $$ for display math.
-rw-r--r--src/Text/Pandoc/Writers/DokuWiki.hs5
-rw-r--r--tests/writer.dokuwiki2
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: