DokuWiki writer: use $$ for display math.
commit6bfaa5ad15d2c3acfc61ddf5ec442ca733016373
authorJohn MacFarlane <jgm@berkeley.edu>
dateTue 8 Mar 2016, 10:08 (11 years ago)
parent0b9c54d
src/Text/Pandoc/Writers/DokuWiki.hs+4−1
@@ -452,8 +452,11 @@ inlineToDokuWiki _ (Code _ str) =
452452
453453inlineToDokuWiki _ (Str str) = return $ escapeString str
454454
455−inlineToDokuWiki _ (Math _ str) = return $ "$" ++ str ++ "$"
455+inlineToDokuWiki _ (Math mathType str) = return $ delim ++ str ++ delim
456456 -- note: str should NOT be escaped
457+ where delim = case mathType of
458+ DisplayMath -> "$$"
459+ InlineMath -> "$"
457460
458461inlineToDokuWiki _ (RawInline f str)
459462 | f == Format "dokuwiki" = return str
tests/writer.dokuwiki+1−1
@@ -459,7 +459,7 @@ Ellipses…and…and….
459459 * $\alpha \wedge \omega$
460460 * $223$
461461 * $p$-Tree
462− * Here’s some display math: $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
462+ * Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
463463 * Here’s one that has a line break in it: $\alpha + \omega \times x^2$.
464464
465465These shouldn’t be math: