aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-06-12 09:35:27 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-06-12 09:35:27 -0700
commit417346068989d6b5bdca3620dcb95cbe4e7d8bbf (patch)
tree217a9a1d9cee5003fa56d46f90d8110d7862303b /src/Text/Pandoc/Writers/HTML.hs
parent1e45bb0041a184a6ae02549c4deb4a9cdf26ecb3 (diff)
downloadpandoc-417346068989d6b5bdca3620dcb95cbe4e7d8bbf.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index a09ad2fda..f07d0381f 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -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