From 4292f9ed6bd2b57ceb740bf475d0aafbd7a8cb63 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 20 Apr 2015 08:27:43 -0400 Subject: [PATCH] Don't insert mstyle in InternalMath() when not necessary. --- unpacked/jax/input/TeX/jax.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 4b121102e..03ca9f082 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1679,7 +1679,7 @@ } var text = string.substr(this.i,i-this.i); if (!text.match(/^\s*\\text[^a-zA-Z]/)) { - this.Push.apply(this,this.InternalMath(text)); + this.Push.apply(this,this.InternalMath(text,0)); this.i = i; } } @@ -2054,8 +2054,11 @@ if (match !== '') TEX.Error(["MathNotTerminated","Math not terminated in text box"]); } if (k < text.length) mml.push(this.InternalText(text.slice(k),def)); - var mml = [MML.mstyle.apply(MML,mml).With({displaystyle:false})]; - if (level != null) mml[0].scriptlevel = level; + if (level != null) { + mml = [MML.mstyle.apply(MML,mml).With({displaystyle:false,scriptlevel:level})]; + } else if (mml.length > 1) { + mml = [MML.mrow.apply(MML,mml)]; + } return mml; }, InternalText: function (text,def) {