From ad0d7760f0ebd1fecd5adb5179b776d5ae7ce991 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 7 May 2014 05:29:31 -0400 Subject: [PATCH] Improve handling of removal of   for IE in AlignBox --- unpacked/jax/output/HTML-CSS/jax.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 2c352a81f..3eb7479da 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -1201,7 +1201,14 @@ }, alignBox: function (span,align,y) { this.placeBox(span,0,y); // set y position (and left aligned) - if (this.msiePlaceBoxBug) {span.removeChild(span.lastChild.previousSibling)} + if (this.msiePlaceBoxBug) { + // + // placeBox() adds an extra  , so remove it here. + // + var node = span.lastChild; + while (node && node.nodeName !== "#text") {node = node.previousSibling} + if (node) {span.removeChild(node)} + } var bbox = span.bbox; if (bbox.isMultiline) return; var isRelative = bbox.width != null && !bbox.isFixed; var r = 0, c = -bbox.w/2, l = "50%";