Save preview in script.MathJax to fix issue #975.

This commit is contained in:
Davide P. Cervone 2014-12-26 17:49:59 -05:00
parent 252fda6762
commit 501b96c859

View File

@ -86,10 +86,11 @@
Preview: function (data) {
if (this.config.disabled || !SETTINGS.CHTMLpreview ||
SETTINGS.renderer === "CommonHTML") return;
var preview = data.script.previousSibling;
var preview = data.script.MathJax.preview || data.script.previousSibling;
if (!preview || preview.className !== MathJax.Hub.config.preRemoveClass) {
preview = HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass});
data.script.parentNode.insertBefore(preview,data.script);
data.script.MathJax.preview = preview;
}
preview.innerHTML = "";
return this.postFilter(preview,data);