diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2018-11-05 13:58:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-05 13:58:11 -0800 |
commit | 8a491e437f1c8379b66a420f8584c1761b45aa7e (patch) | |
tree | a608c0afd9f238376801e7fcf8588a2bac59f81c /haddock-api/src/Haddock/Backends/Xhtml | |
parent | 0d9a81e20238a6b72f9f5c005f1f7e9cf05f6fb9 (diff) |
Only run MathJax on entities with "mathjax" class (#960)
Correspondingly, we wrap all inline/diplay math in
<span class="mathjax"> ... the math .... </span>
This fixes #959.
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index ed323a90..38aa7b7e 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -69,8 +69,8 @@ parHtmlMarkup qual insertAnchors ppId = Markup { then namedAnchor aname << "" else noHtml, markupPic = \(Picture uri t) -> image ! ([src uri] ++ fromMaybe [] (return . title <$> t)), - markupMathInline = \mathjax -> toHtml ("\\(" ++ mathjax ++ "\\)"), - markupMathDisplay = \mathjax -> toHtml ("\\[" ++ mathjax ++ "\\]"), + markupMathInline = \mathjax -> thespan ! [theclass "mathjax"] << toHtml ("\\(" ++ mathjax ++ "\\)"), + markupMathDisplay = \mathjax -> thespan ! [theclass "mathjax"] << toHtml ("\\[" ++ mathjax ++ "\\]"), markupProperty = pre . toHtml, markupExample = examplesToHtml, markupHeader = \(Header l t) -> makeHeader l t, |