reveal.js writer and template: reuse mathjax URL...

...provided by the argument to `--mathjax` or the normal
pandoc default, rather than a hard-coded one in the template.

Closes #4701.
This commit is contained in:
John MacFarlane
2018-06-12 09:35:27 -07:00
parent 1e45bb0041
commit 4173460689
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -259,7 +259,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
st <- get
notes <- footnoteSection opts (reverse (stNotes st))
let thebody = blocks' >> notes
let math = case writerHTMLMathMethod opts of
let math = case writerHTMLMathMethod opts of
MathJax url
| slideVariant /= RevealJsSlides ->
-- mathjax is handled via a special plugin in revealjs
@@ -296,10 +296,11 @@ pandocToHtml opts (Pandoc meta blocks) = do
(if stMath st
then defField "math" (renderHtml' math)
else id) $
defField "mathjax"
(case writerHTMLMathMethod opts of
MathJax _ -> True
_ -> False) $
(case writerHTMLMathMethod opts of
MathJax u -> defField "mathjax" True .
defField "mathjaxurl"
(takeWhile (/='?') u)
_ -> defField "mathjax" False) $
defField "quotes" (stQuotes st) $
-- for backwards compatibility we populate toc
-- with the contents of the toc, rather than a