git.iko.soy/typeable/pandoc
on master help sign in
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.

commit417346068989d6b5bdca3620dcb95cbe4e7d8bbf authorJohn MacFarlane <jgm@berkeley.edu> dateTue 12 Jun 2018, 09:35 (8 years ago) parent1e45bb0
2 files changed+7−6
data/templates/default.revealjs+1−1 src/Text/Pandoc/Writers/HTML.hs+6−5
data/templates/default.revealjs+1−1
@@ -237,7 +237,7 @@ $if(maxScale)$
237237$endif$
238238$if(mathjax)$
239239 math: {
240− mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
240+ mathjax: '$mathjaxurl$',
241241 config: 'TeX-AMS_HTML-full',
242242 tex2jax: {
243243 inlineMath: [['\\(','\\)']],
src/Text/Pandoc/Writers/HTML.hs+6−5
@@ -259,7 +259,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
259259 st <- get
260260 notes <- footnoteSection opts (reverse (stNotes st))
261261 let thebody = blocks' >> notes
262− let math = case writerHTMLMathMethod opts of
262+ let math = case writerHTMLMathMethod opts of
263263 MathJax url
264264 | slideVariant /= RevealJsSlides ->
265265 -- mathjax is handled via a special plugin in revealjs
@@ -296,10 +296,11 @@ pandocToHtml opts (Pandoc meta blocks) = do
296296 (if stMath st
297297 then defField "math" (renderHtml' math)
298298 else id) $
299− defField "mathjax"
300− (case writerHTMLMathMethod opts of
301− MathJax _ -> True
302− _ -> False) $
299+ (case writerHTMLMathMethod opts of
300+ MathJax u -> defField "mathjax" True .
301+ defField "mathjaxurl"
302+ (takeWhile (/='?') u)
303+ _ -> defField "mathjax" False) $
303304 defField "quotes" (stQuotes st) $
304305 -- for backwards compatibility we populate toc
305306 -- with the contents of the toc, rather than a