From edfe2899838708d405aa7aeaff2b8cf712144996 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 15 Mar 2015 09:25:44 -0400 Subject: [PATCH] Handle msup and msub children properly. --- unpacked/jax/output/CommonHTML/jax.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index affa68adb..af28055a9 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -1664,10 +1664,10 @@ var types = ["mjx-base","mjx-sub","mjx-sup"]; if (this.sup === 1) types[1] = types[2]; node = this.CHTMLdefaultNode(node,{ - childNodes:types, noBBox:true, forceChild:true, minChildren: 2 + childNodes:types, noBBox:true, forceChild:true, minChildren: 3 }); - var base, sub, sup; base = node.firstChild; sub = sup = base.nextSibling; - if (sub.nextSibling) sup = sub.nextSibling; + var base, sub, sup; base = node.childNodes[this.base]; + sub = node.childNodes[this.sub]; sup = node.childNodes[this.sup]; if (!this.CHTMLnotEmpty(this.data[this.sub])) {node.removeChild(sub); sub = null} if (!this.CHTMLnotEmpty(this.data[this.sup])) {node.removeChild(sup); sup = null} if (node.childNodes.length === 3) { @@ -1675,7 +1675,7 @@ stack.appendChild(sup); stack.appendChild(sub); } // - // Get the scale of the base and its limits + // Get the scale of the base and its scripts // var sscale = 1; if (values.scriptlevel < 2) {