diff --git a/unpacked/jax/element/mml/jax.js b/unpacked/jax/element/mml/jax.js index 64fc492f2..13e46b7f8 100644 --- a/unpacked/jax/element/mml/jax.js +++ b/unpacked/jax/element/mml/jax.js @@ -232,7 +232,8 @@ MathJax.ElementJax.mml.Augment({ type: "base", isToken: false, defaults: { mathbackground: MML.INHERIT, - mathcolor: MML.INHERIT + mathcolor: MML.INHERIT, + dir: MML.INHERIT, }, noInherit: {}, noInheritAttribute: { @@ -428,7 +429,8 @@ MathJax.ElementJax.mml.Augment({ mathvariant: MML.AUTO, mathsize: MML.INHERIT, mathbackground: MML.INHERIT, - mathcolor: MML.INHERIT + mathcolor: MML.INHERIT, + dir: MML.INHERIT }, autoDefault: function (name) { if (name === "mathvariant") { @@ -458,7 +460,8 @@ MathJax.ElementJax.mml.Augment({ mathvariant: MML.INHERIT, mathsize: MML.INHERIT, mathbackground: MML.INHERIT, - mathcolor: MML.INHERIT + mathcolor: MML.INHERIT, + dir: MML.INHERIT } }); @@ -469,6 +472,7 @@ MathJax.ElementJax.mml.Augment({ mathsize: MML.INHERIT, mathbackground: MML.INHERIT, mathcolor: MML.INHERIT, + dir: MML.INHERIT, form: MML.AUTO, fence: MML.AUTO, separator: MML.AUTO, @@ -630,7 +634,8 @@ MathJax.ElementJax.mml.Augment({ mathvariant: MML.INHERIT, mathsize: MML.INHERIT, mathbackground: MML.INHERIT, - mathcolor: MML.INHERIT + mathcolor: MML.INHERIT, + dir: MML.INHERIT } }); @@ -665,6 +670,7 @@ MathJax.ElementJax.mml.Augment({ mathsize: MML.INHERIT, mathbackground: MML.INHERIT, mathcolor: MML.INHERIT, + dir: MML.INHERIT, lquote: '"', rquote: '"' } @@ -810,6 +816,7 @@ MathJax.ElementJax.mml.Augment({ scriptminsize: "8pt", mathbackground: MML.INHERIT, mathcolor: MML.INHERIT, + dir: MML.INHERIT, infixlinebreakstyle: MML.LINEBREAKSTYLE.BEFORE, decimalseparator: "." }, @@ -1226,6 +1233,7 @@ MathJax.ElementJax.mml.Augment({ mathsize: MML.SIZE.NORMAL, mathcolor: "", // should be "black", but allow it to inherit from surrounding text mathbackground: MML.COLOR.TRANSPARENT, + dir: "ltr", scriptlevel: 0, displaystyle: MML.AUTO, display: "inline", diff --git a/unpacked/jax/input/AsciiMath/jax.js b/unpacked/jax/input/AsciiMath/jax.js index 525b94e41..9e31d10b3 100644 --- a/unpacked/jax/input/AsciiMath/jax.js +++ b/unpacked/jax/input/AsciiMath/jax.js @@ -1292,7 +1292,8 @@ junk = null; formatError: function (err,math,script) { var message = err.message.replace(/\n.*/,""); MathJax.Hub.signal.Post(["AsciiMath Jax - parse error",message,math,script]); - return MML.merror(message); + var mml = MML.merror(message); + return (MathJax.Localization.fontDirection() ? MML.mstyle(mml).With({dir: "rtl"}) : mml); }, Error: function (message) { throw MathJax.Hub.Insert(Error(message),{asciimathError: true}); diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index 86e11c031..c8c508a76 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -267,7 +267,8 @@ formatError: function (err,math,script) { var message = err.message.replace(/\n.*/,""); MathJax.Hub.signal.Post(["MathML Jax - parse error",message,math,script]); - return MML.merror(message); + var mml = MML.merror(message); + return (MathJax.Localization.fontDirection() ? MML.mstyle(mml).With({dir: "rtl"}) : mml); }, Error: function (message) { // diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index cc75287b4..974ef5e91 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -2099,7 +2099,8 @@ formatError: function (err,math,display,script) { var message = err.message.replace(/\n.*/,""); HUB.signal.Post(["TeX Jax - parse error",message,math,display,script]); - return MML.merror(message); + var mml = MML.merror(message); + return (MathJax.Localization.fontDirection() ? MML.mstyle(mml).With({dir: "rtl"}) : mml); }, // diff --git a/unpacked/jax/output/HTML-CSS/autoload/ms.js b/unpacked/jax/output/HTML-CSS/autoload/ms.js index a45baa1be..9ceb6478f 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/ms.js +++ b/unpacked/jax/output/HTML-CSS/autoload/ms.js @@ -41,6 +41,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { this.HTMLhandleVariant(span,this.HTMLgetVariant(),values.lquote+text+values.rquote); this.HTMLhandleSpace(span); this.HTMLhandleColor(span); + this.HTMLhandleDir(span); return span; }, HTMLquoteRegExp: function (string) { diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 8ed062352..7653663a1 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -223,7 +223,6 @@ "word-wrap": "normal", "white-space": "nowrap", "float": "none", - "direction": "ltr", border: 0, padding: 0, margin: 0 }, @@ -1723,6 +1722,11 @@ return span; }, + HTMLhandleDir: function (span) { + span.style.direction = this.Get("dir"); + return span; + }, + HTMLhandleColor: function (span) { var values = this.getValues("mathcolor","color"); if (this.mathbackground) {values.mathbackground = this.mathbackground} @@ -1973,6 +1977,7 @@ } this.HTMLhandleSpace(span); this.HTMLhandleColor(span); + this.HTMLhandleDir(span); return span; } }); @@ -1987,6 +1992,7 @@ if (this.data.join("").length !== 1) {delete span.bbox.skew} this.HTMLhandleSpace(span); this.HTMLhandleColor(span); + this.HTMLhandleDir(span); return span; } }); @@ -2061,6 +2067,7 @@ // this.HTMLhandleSpace(span); this.HTMLhandleColor(span); + this.HTMLhandleDir(span); return span; }, CoreParent: function () { @@ -2157,6 +2164,7 @@ if (this.data.join("").length !== 1) {delete span.bbox.skew} this.HTMLhandleSpace(span); this.HTMLhandleColor(span); + this.HTMLhandleDir(span); return span; } }); @@ -2296,6 +2304,7 @@ } this.HTMLhandleSpace(span); this.HTMLhandleColor(span); + this.HTMLhandleDir(span); return span; }, HTMLstretchH: MML.mbase.HTMLstretchH, @@ -2689,6 +2698,10 @@ // Add color (if any) // this.HTMLhandleColor(span); + // + // Add direction (if any) + // + this.HTMLhandleDir(span); // // Make math span be the correct height and depth //