aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml
diff options
context:
space:
mode:
authorDominic Steinitz <dominic@steinitz.org>2015-05-16 12:32:23 +0100
committerDominic Steinitz <dominic@steinitz.org>2015-12-21 07:19:16 +0000
commite01e4790402204af02ab0127ef5b633fb7748cd4 (patch)
tree88be1e3c3b74ec27db6e02264dba9f32d58a32d3 /haddock-api/src/Haddock/Backends/Xhtml
parent2bdfda1fb2e0de696ca8c6f7a152b2f85a541be9 (diff)
Handle inline math with mathjax.
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
index 3fe74a82..b291af0b 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -33,6 +33,7 @@ import Data.Maybe (fromMaybe)
import GHC
import Name
+
parHtmlMarkup :: Qualification -> Bool
-> (Bool -> a -> Html) -> DocMarkup a Html
parHtmlMarkup qual insertAnchors ppId = Markup {
@@ -67,6 +68,7 @@ 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 ++ "\\)"),
markupProperty = pre . toHtml,
markupExample = examplesToHtml,
markupHeader = \(Header l t) -> makeHeader l t