Don't include mathml javascript for html5 output.

mathml is supposed to be supported in HTML5.
This commit is contained in:
John MacFarlane 2012-01-31 10:47:48 -08:00
parent 3880828415
commit e9a270d03b
2 changed files with 6 additions and 5 deletions

8
README
View file

@ -544,10 +544,10 @@ Math rendering in HTML
so it can be cached. so it can be cached.
`--mathml`[=*URL*] `--mathml`[=*URL*]
: Convert TeX math to MathML (works with `docbook` as well as `html`). : Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
In standalone mode, a small javascript (or a link to such a script if a In standalone `html` output, a small javascript (or a link to such a
*URL* is supplied) will be inserted that allows the MathML to be viewed on script if a *URL* is supplied) will be inserted that allows the MathML to
some browsers. be viewed on some browsers.
`--jsmath`[=*URL*] `--jsmath`[=*URL*]
: Use [jsMath] to display embedded TeX math in HTML output. : Use [jsMath] to display embedded TeX math in HTML output.

View file

@ -147,10 +147,11 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
! A.type_ "text/javascript" ! A.type_ "text/javascript"
$ mempty $ mempty
_ -> case lookup "mathml-script" (writerVariables opts) of _ -> case lookup "mathml-script" (writerVariables opts) of
Just s -> Just s | not (writerHtml5 opts) ->
H.script ! A.type_ "text/javascript" H.script ! A.type_ "text/javascript"
$ preEscapedString $ preEscapedString
("/*<![CDATA[*/\n" ++ s ++ "/*]]>*/\n") ("/*<![CDATA[*/\n" ++ s ++ "/*]]>*/\n")
| otherwise -> mempty
Nothing -> mempty Nothing -> mempty
else mempty else mempty
let newvars = [("highlighting-css", let newvars = [("highlighting-css",