From 0d192ebf703ec99a5b2ed88b7aeb75f8d74ac5c1 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 6 Jun 2016 07:41:18 -0400 Subject: [PATCH] Make getJaxForMath() work even during chunking. Resolves issue mathjax/MathJax-RespEq#119. --- unpacked/jax/output/HTML-CSS/jax.js | 2 +- unpacked/jax/output/PlainSource/jax.js | 2 +- unpacked/jax/output/PreviewHTML/jax.js | 2 +- unpacked/jax/output/SVG/jax.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index ec9ac237f..0407b35ab 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -794,7 +794,7 @@ }, getJaxFromMath: function (math) { - if (math.parentNode.className === "MathJax_Display") {math = math.parentNode} + if (math.parentNode.className.match(/MathJax_Display/)) {math = math.parentNode} do {math = math.nextSibling} while (math && math.nodeName.toLowerCase() !== "script"); return HUB.getJaxFor(math); }, diff --git a/unpacked/jax/output/PlainSource/jax.js b/unpacked/jax/output/PlainSource/jax.js index f71587e58..5ff4eaaac 100644 --- a/unpacked/jax/output/PlainSource/jax.js +++ b/unpacked/jax/output/PlainSource/jax.js @@ -141,7 +141,7 @@ postTranslate: function(state) {}, getJaxFromMath: function(math) { - if (math.parentNode.className === "MathJax_PlainSource_Display") math = math.parentNode; + if (math.parentNode.className.match(/MathJax_PlainSource_Display/)) math = math.parentNode; do {math = math.nextSibling} while (math && math.nodeName.toLowerCase() !== "script"); return HUB.getJaxFor(math); }, diff --git a/unpacked/jax/output/PreviewHTML/jax.js b/unpacked/jax/output/PreviewHTML/jax.js index 7752699a8..b86ad7867 100644 --- a/unpacked/jax/output/PreviewHTML/jax.js +++ b/unpacked/jax/output/PreviewHTML/jax.js @@ -276,7 +276,7 @@ }, getJaxFromMath: function (math) { - if (math.parentNode.className === "MathJax_PHTML_Display") {math = math.parentNode} + if (math.parentNode.className.match(/MathJax_PHTML_Display/)) {math = math.parentNode} do {math = math.nextSibling} while (math && math.nodeName.toLowerCase() !== "script"); return HUB.getJaxFor(math); }, diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index d8edf98c4..db854e125 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -413,7 +413,7 @@ }, getJaxFromMath: function (math) { - if (math.parentNode.className === "MathJax_SVG_Display") {math = math.parentNode} + if (math.parentNode.className.match(/MathJax_SVG_Display/)) {math = math.parentNode} do {math = math.nextSibling} while (math && math.nodeName.toLowerCase() !== "script"); return HUB.getJaxFor(math); },