summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/Markdown.hs')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index d08998eef..e3bb3eea0 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -979,15 +979,19 @@ inlineToMarkdown opts (Math InlineMath str) =
inlineListToMarkdown opts $
(if plain then makeMathPlainer else id) $
texMathToInlines InlineMath str
-inlineToMarkdown opts (Math DisplayMath str)
- | isEnabled Ext_tex_math_dollars opts =
- return $ "$$" <> text str <> "$$"
- | isEnabled Ext_tex_math_single_backslash opts =
- return $ "\\[" <> text str <> "\\]"
- | isEnabled Ext_tex_math_double_backslash opts =
- return $ "\\\\[" <> text str <> "\\\\]"
- | otherwise = (\x -> cr <> x <> cr) `fmap`
- inlineListToMarkdown opts (texMathToInlines DisplayMath str)
+inlineToMarkdown opts (Math DisplayMath str) =
+ case writerHTMLMathMethod opts of
+ WebTeX url -> (\x -> blankline <> x <> blankline) `fmap`
+ inlineToMarkdown opts (Image nullAttr [Str str]
+ (url ++ urlEncode str, str))
+ _ | isEnabled Ext_tex_math_dollars opts ->
+ return $ "$$" <> text str <> "$$"
+ | isEnabled Ext_tex_math_single_backslash opts ->
+ return $ "\\[" <> text str <> "\\]"
+ | isEnabled Ext_tex_math_double_backslash opts ->
+ return $ "\\\\[" <> text str <> "\\\\]"
+ | otherwise -> (\x -> cr <> x <> cr) `fmap`
+ inlineListToMarkdown opts (texMathToInlines DisplayMath str)
inlineToMarkdown opts (RawInline f str) = do
plain <- asks envPlain
if not plain &&