aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-05-09 11:29:20 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-05-09 11:29:20 -0700
commitb7356d3ddf788d83b41b1100d718087bd83a7506 (patch)
treee3d8147a349999937dfc60d55179b6aab0649b46 /src/Text/Pandoc/Writers/HTML.hs
parentd3be567a73478298485f66b2d2af5ca066eae052 (diff)
downloadpandoc-b7356d3ddf788d83b41b1100d718087bd83a7506.tar.gz
Restored and undeprecated gladtex for HTML math.
- Added `GladTeX` constructor to `Text.Pandoc.Options.HTMLMathMethod` [API change, reverts removal in v2.2] - Restored and undeprecated `--gladtex` option, removed in v2.2. Closes #4607.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 535071ae2..a09ad2fda 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -58,7 +58,7 @@ import qualified Data.Text.Lazy as TL
import Network.HTTP (urlEncode)
import Network.URI (URI (..), parseURIReference, unEscapeString)
import Numeric (showHex)
-import Text.Blaze.Internal (customLeaf, MarkupM(Empty))
+import Text.Blaze.Internal (customLeaf, customParent, MarkupM(Empty))
#if MIN_VERSION_blaze_markup(0,6,3)
#else
import Text.Blaze.Internal (preEscapedString, preEscapedText)
@@ -1029,6 +1029,13 @@ inlineToHtml opts inline = do
return $ case t of
InlineMath -> m
DisplayMath -> brtag >> m >> brtag
+ GladTeX ->
+ return $
+ customParent (textTag "eq") !
+ customAttribute "env"
+ (toValue $ if t == InlineMath
+ then ("math" :: Text)
+ else "displaymath") $ strToHtml str
MathML -> do
let conf = useShortEmptyTags (const False)
defaultConfigPP