aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 1f0ee5410..dbda5067f 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -318,6 +318,10 @@ pandocToHtml opts (Pandoc meta blocks) = do
defField "mathjaxurl"
(T.takeWhile (/='?') u)
_ -> defField "mathjax" False) $
+ (case writerHTMLMathMethod opts of
+ PlainMath -> defField "displaymath-css" True
+ WebTeX _ -> defField "displaymath-css" True
+ _ -> id) $
defField "quotes" (stQuotes st) $
-- for backwards compatibility we populate toc
-- with the contents of the toc, rather than a
@@ -1108,14 +1112,11 @@ inlineToHtml opts inline = do
let s = case t of
InlineMath -> "\\textstyle "
DisplayMath -> "\\displaystyle "
- let m = imtag ! A.style "vertical-align:middle"
- ! A.src (toValue $ url <> T.pack (urlEncode (T.unpack $ s <> str)))
- ! A.alt (toValue str)
- ! A.title (toValue str)
- let brtag = if html5 then H5.br else H.br
- return $ case t of
- InlineMath -> m
- DisplayMath -> brtag >> m >> brtag
+ return $ imtag ! A.style "vertical-align:middle"
+ ! A.src (toValue $ url <> T.pack (urlEncode (T.unpack $ s <> str)))
+ ! A.alt (toValue str)
+ ! A.title (toValue str)
+ ! A.class_ mathClass
GladTeX ->
return $
customParent (textTag "eq") !
@@ -1142,11 +1143,7 @@ inlineToHtml opts inline = do
DisplayMath -> str
PlainMath -> do
x <- lift (texMathToInlines t str) >>= inlineListToHtml opts
- let m = H.span ! A.class_ mathClass $ x
- let brtag = if html5 then H5.br else H.br
- return $ case t of
- InlineMath -> m
- DisplayMath -> brtag >> m >> brtag
+ return $ H.span ! A.class_ mathClass $ x
(RawInline f str) -> do
ishtml <- isRawHtml f
if ishtml