Skip to content

Commit 4292f9e

Browse files
committed
Don't insert mstyle in InternalMath() when not necessary.
1 parent 65937e6 commit 4292f9e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

unpacked/jax/input/TeX/jax.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@
16791679
}
16801680
var text = string.substr(this.i,i-this.i);
16811681
if (!text.match(/^\s*\\text[^a-zA-Z]/)) {
1682-
this.Push.apply(this,this.InternalMath(text));
1682+
this.Push.apply(this,this.InternalMath(text,0));
16831683
this.i = i;
16841684
}
16851685
}
@@ -2054,8 +2054,11 @@
20542054
if (match !== '') TEX.Error(["MathNotTerminated","Math not terminated in text box"]);
20552055
}
20562056
if (k < text.length) mml.push(this.InternalText(text.slice(k),def));
2057-
var mml = [MML.mstyle.apply(MML,mml).With({displaystyle:false})];
2058-
if (level != null) mml[0].scriptlevel = level;
2057+
if (level != null) {
2058+
mml = [MML.mstyle.apply(MML,mml).With({displaystyle:false,scriptlevel:level})];
2059+
} else if (mml.length > 1) {
2060+
mml = [MML.mrow.apply(MML,mml)];
2061+
}
20592062
return mml;
20602063
},
20612064
InternalText: function (text,def) {

0 commit comments

Comments
 (0)