From 3ee5ca30bbfd97475b4e07569f0d0bba1c77bd9e Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Thu, 23 Jun 2016 20:37:25 -0400 Subject: [PATCH] Don't let preview width interfere with the determination of the container width. Resolves issue #1364. --- unpacked/jax/output/CommonHTML/jax.js | 6 ++++-- unpacked/jax/output/HTML-CSS/jax.js | 2 ++ unpacked/jax/output/SVG/jax.js | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index 0b48f9ae2..f65492ec6 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -404,6 +404,7 @@ prev = script.previousSibling; if (prev && prev.className && String(prev.className).substr(0,9) === "mjx-chtml") prev.parentNode.removeChild(prev); + if (script.MathJax.preview) script.MathJax.preview.style.display = "none"; // // Add the node for the math and mark it as being processed // @@ -465,11 +466,12 @@ // for (i = 0; i < m; i++) { script = scripts[i]; if (!script.parentNode) continue; - test = scripts[i].previousSibling; + test = scripts.previousSibling; span = test.previousSibling; - jax = scripts[i].MathJax.elementJax; if (!jax) continue; + jax = scripts.MathJax.elementJax; if (!jax) continue; span.parentNode.removeChild(span); test.parentNode.removeChild(test); + if (script.MathJax.preview) script.MathJax.preview.style.display = ""; } state.CHTMLeqn = state.CHTMLlast = 0; state.CHTMLi = -1; state.CHTMLchunk = this.config.EqnChunk; diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 8dad7d6aa..efef875ac 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -577,6 +577,7 @@ prev = script.previousSibling; if (prev && String(prev.className).match(/^MathJax(_Display)?( MathJax_Processing)?$/)) {prev.parentNode.removeChild(prev)} + if (script.MathJax.preview) script.MathJax.preview.style.display = "none"; // // Add the span, and a div if in display mode, // then mark it as being processed @@ -652,6 +653,7 @@ if (!jax.HTMLCSS.isHidden) {span = span.previousSibling} span.parentNode.removeChild(span); test.parentNode.removeChild(test); + if (script.MathJax.preview) script.MathJax.preview.style.display = ""; } // // Set state variables used for displaying equations in chunks diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index d6b7f4274..e9f34961d 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -221,6 +221,7 @@ prev = script.previousSibling; if (prev && String(prev.className).match(/^MathJax(_SVG)?(_Display)?( MathJax(_SVG)?_Process(ing|ed))?$/)) {prev.parentNode.removeChild(prev)} + if (script.MathJax.preview) script.MathJax.preview.style.display = "none"; // // Add the span, and a div if in display mode, // then set the role and mark it as being processed @@ -285,6 +286,7 @@ if (!jax.SVG.isHidden) {span = span.previousSibling} span.parentNode.removeChild(span); test.parentNode.removeChild(test); + if (script.MathJax.preview) script.MathJax.preview.style.display = ""; } // // Set state variables used for displaying equations in chunks