Skip to content

Commit 27b89a9

Browse files
committed
upgrade to mathjax v3 (always loads latest available 3.x.x version)
1 parent 967d0a7 commit 27b89a9

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

rednotebook/util/markup.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,26 +108,15 @@
108108

109109
# MathJax
110110
FORMULAS_SUPPORTED = True
111-
MATHJAX_FILE = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"
111+
MATHJAX_FILE = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"
112112

113113
# Explicitly setting inlineMath: [ ['\\(','\\)'] ] doesn't work.
114114
# Using defaults:
115115
# displayMath: [ ['$$','$$'], ['\[','\]'] ]
116116
# inlineMath: [['\(','\)']]
117117
MATHJAX_DELIMITERS = ["$$", "\\(", "\\)", r"\\[", "\\]"]
118118
MATHJAX = """\
119-
<script type="text/x-mathjax-config">
120-
MathJax.Hub.Config({{
121-
messageStyle: "none",
122-
config: ["MMLorHTML.js"],
123-
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
124-
tex2jax: {{}},
125-
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
126-
TeX: {{
127-
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
128-
}}
129-
}});
130-
</script>
119+
<!--MathJax included-->
131120
<script type="text/javascript" src="{MATHJAX_FILE}"></script>
132121
""".format(
133122
**locals()

tests/test_markup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def test_day_fragment_anchor_element(self, process):
234234

235235
def test_mathjax(self, process):
236236
document = process("$$x^3$$")
237-
assert r'<script type="text/x-mathjax-config">' in document
237+
assert r'<!--MathJax included-->' in document
238238

239239

240240
class TestGetTexExportConfig:

0 commit comments

Comments
 (0)