commit 64ed60ac51150061ae5d745b72ba19f766869c20
parent 562786da5ed9be85d4802238e8798c25914eb7c6
Author: Davide P. Cervone <dpvc@union.edu>
Date: Fri, 17 Apr 2015 17:22:48 -0400
Change how combining characters are handled so that they show up in IE but are still placed properly in Chrome (putting them over a non-breaking space got the baseline wrong in Chrome for some reason, and over a space got the width wrong).
Diffstat:
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js
@@ -113,6 +113,7 @@
"mjx-box": {display:"inline-block"},
"mjx-block": {display:"block"},
+ "mjx-span": {display:"span"},
"mjx-char": {display:"block"},
"mjx-itable": {display:"inline-table"},
"mjx-row": {display:"table-row"},
@@ -1758,12 +1759,10 @@
// IE doesn't display combining chararacters unless they combine with
// something, so put them over a space and remove the space's width
//
- var char = node.firstChild.textContent;
- node.firstChild.innerHTML = "\u00A0" + char;
- var font = this.CHTMLvariant.cache[char.charCodeAt(0)][0].font;
- var space = font[0xA0] || font[0x20];
- var w = space[2] / (space.c ? 1 : 1000);
- node.firstChild.style.marginLeft = CHTML.Em(-w);
+ node = node.firstChild;
+ var char = node.textContent;
+ var space = HTML.Element("mjx-span",{style:{width:".25em","margin-left":"-.25em"}});
+ node.insertBefore(space,node.firstChild);
},
CHTMLcenterOp: function (node) {
var bbox = this.CHTML;