Make sure CommonHTML output is marked by isMathJax

This commit is contained in:
Davide P. Cervone 2015-09-12 07:30:54 -04:00
parent bde96342e6
commit b1647c98e7

View File

@ -323,6 +323,7 @@
Element: function (type,def,content) { Element: function (type,def,content) {
if (type.substr(0,4) === "mjx-") { if (type.substr(0,4) === "mjx-") {
if (!def) def = {}; if (!def) def = {};
if (def.isMathJax == null) def.isMathJax = true;
if (def.className) def.className = type+" "+def.className; else def.className = type; if (def.className) def.className = type+" "+def.className; else def.className = type;
} }
return this.HTMLElement("span",def,content); return this.HTMLElement("span",def,content);
@ -379,7 +380,7 @@
// //
// Zoom box requires an outer container to get the positioning right. // Zoom box requires an outer container to get the positioning right.
// //
var NODE = CHTML.Element("mjx-chtml",{className:"MJXc-display"}); var NODE = CHTML.Element("mjx-chtml",{className:"MJXc-display",isMathJax:false});
NODE.appendChild(node); node = NODE; NODE.appendChild(node); node = NODE;
} }
if (HUB.Browser.noContextMenu) { if (HUB.Browser.noContextMenu) {
@ -579,7 +580,7 @@
// Re-render at larger size // Re-render at larger size
// //
this.getMetrics(jax); this.getMetrics(jax);
var node = CHTML.addElement(span,"mjx-chtml",{style:{"font-size":Math.floor(CHTML.scale*100)+"%"}}); var node = CHTML.addElement(span,"mjx-chtml",{style:{"font-size":Math.floor(CHTML.scale*100)+"%"},isMathJax:false});
this.idPostfix = "-zoom"; jax.root.toCommonHTML(node); this.idPostfix = ""; this.idPostfix = "-zoom"; jax.root.toCommonHTML(node); this.idPostfix = "";
// //
// Adjust margins to prevent overlaps at the edges // Adjust margins to prevent overlaps at the edges