@@ -55,6 +55,7 @@ import qualified Data.HashMap.Strict as H
55import qualified Data.Vector as V
55import qualified Data.Vector as V
56import qualified Data.Text as T
56import qualified Data.Text as T
57import qualified Data.Set as Set
57import qualified Data.Set as Set
58+import Network.HTTP ( urlEncode )
59type Notes = [[Block]]
60type Notes = [[Block]]
60type Ref = ([Inline], Target, Attr)
61type Ref = ([Inline], Target, Attr)
@@ -856,18 +857,22 @@ inlineToMarkdown opts (Str str) = do
856 if stPlain st
857 if stPlain st
857 then return $ text str
858 then return $ text str
858 else return $ text $ escapeString opts str
859 else return $ text $ escapeString opts str
859−inlineToMarkdown opts (Math InlineMath str)
860+inlineToMarkdown opts (Math InlineMath str) =
861+ case writerHTMLMathMethod opts of
863+ inlineToMarkdown opts (Image nullAttr [Str str]
864+ (url ++ urlEncode str, str))
860− | isEnabled Ext_tex_math_dollars opts =
865+ _ | isEnabled Ext_tex_math_dollars opts ->
861− return $ "$" <> text str <> "$"
866+ return $ "$" <> text str <> "$"
862− | isEnabled Ext_tex_math_single_backslash opts =
867+ | isEnabled Ext_tex_math_single_backslash opts ->
863− return $ "\\(" <> text str <> "\\)"
868+ return $ "\\(" <> text str <> "\\)"
864− | isEnabled Ext_tex_math_double_backslash opts =
869+ | isEnabled Ext_tex_math_double_backslash opts ->
865− return $ "\\\\(" <> text str <> "\\\\)"
870+ return $ "\\\\(" <> text str <> "\\\\)"
866− | otherwise = do
871+ | otherwise -> do
867− plain <- gets stPlain
872+ plain <- gets stPlain
868− inlineListToMarkdown opts $
873+ inlineListToMarkdown opts $
869− (if plain then makeMathPlainer else id) $
874+ (if plain then makeMathPlainer else id) $
870− texMathToInlines InlineMath str
875+ texMathToInlines InlineMath str
871inlineToMarkdown opts (Math DisplayMath str)
876inlineToMarkdown opts (Math DisplayMath str)
872 | isEnabled Ext_tex_math_dollars opts =
877 | isEnabled Ext_tex_math_dollars opts =
873 return $ "$$" <> text str <> "$$"
878 return $ "$$" <> text str <> "$$"