From 932b7e8f7c8511578c89229ba189584cc50834ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 18 Oct 2013 10:04:47 +0200 Subject: [PATCH 1/6] Experimental Bidi branch. #474, #/610, #627 --- unpacked/jax/element/mml/jax.js | 16 ++++++++++++---- unpacked/jax/input/AsciiMath/jax.js | 3 ++- unpacked/jax/input/MathML/jax.js | 3 ++- unpacked/jax/input/TeX/jax.js | 3 ++- unpacked/jax/output/HTML-CSS/autoload/ms.js | 1 + unpacked/jax/output/HTML-CSS/jax.js | 15 ++++++++++++++- 6 files changed, 33 insertions(+), 8 deletions(-) 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 // From aa8d543a4544a7aa43dd9da9dc304d21fea1d31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 18 Oct 2013 10:40:38 +0200 Subject: [PATCH 2/6] follow-up: add directionality on remaining MathML error messages #627 --- unpacked/jax/input/MathML/jax.js | 4 +++- unpacked/jax/output/HTML-CSS/autoload/mglyph.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index c8c508a76..eec45be2b 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -77,7 +77,9 @@ mml = this.TeXAtom(match[2]); } else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) { MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]); - return MML.merror(_("UnknownNodeType","Unknown node type: %1",type)); + var err = MML.merror(_("UnknownNodeType","Unknown node type: %1",type)); + if (MathJax.Localization.fontDirection()) {err = MML.mstyle(err).With({dir: "rtl"})}; + return err; } else { mml = MML[type](); } diff --git a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js index 97e14835e..5e736d364 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js +++ b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js @@ -46,6 +46,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { if (values.alt === "") {values.alt = LOCALE._(["MathML","BadMglyphFont"],"Bad font: %1",font.family)} err = MML.merror(values.alt).With({mathsize:"75%"}); + if (LOCALE.fontDirection()) {err = MML.mstyle(err).With({dir: "rtl"})}; this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } @@ -65,6 +66,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { err = MML.merror( LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) ).With({mathsize:"75%"}); + if (LOCALE.fontDirection()) {err = MML.mstyle(err).With({dir: "rtl"})}; this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } else { From fdc34e3d8847cceddaf0c9d157b6f515c379cb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 18 Oct 2013 11:32:28 +0200 Subject: [PATCH 3/6] SVG output: Consider dir=rtl for elements that are rendered with an SVG element. #474, #/610, #627 --- unpacked/jax/output/SVG/jax.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 4c39a7bef..ff5d47efc 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -51,7 +51,6 @@ "word-wrap": "normal", "white-space": "nowrap", "float": "none", - "direction": "ltr", border: 0, padding: 0, margin: 0 }, @@ -1465,7 +1464,7 @@ if (this.Parent().type === "merror") { // *** FIXME: Make color, style, scale configurable svg = this.SVG(); this.SVGhandleSpace(svg); - text = BBOX.G(); text.Add(BBOX.TEXT(.9*scale,this.data.join(""),{fill:"#C00"})); + text = BBOX.G(); text.Add(BBOX.TEXT(.9*scale,this.data.join(""),{fill:"#C00",direction:this.Get("dir")})); svg.Add(BBOX.RECT(text.h+100,text.d+100,text.w+200,{fill:"#FF8",stroke:"#C00","stroke-width":50}),0,0); svg.Add(text,150,0); svg.H += 150; svg.D += 50; svg.Clean(); @@ -1473,7 +1472,7 @@ return svg; } else if (SVG.config.mtextFontInherit) { svg = this.SVG(); this.SVGhandleSpace(svg); - var variant = this.SVGgetVariant(), def = {}; + var variant = this.SVGgetVariant(), def = {direction:this.Get("dir")}; if (variant.bold) {def["font-weight"] = "bold"} if (variant.italic) {def["font-style"] = "italic"} svg.Add(BBOX.TEXT(scale,this.data.join(""),def)); svg.Clean(); From a2046c05a310755d5c2ee6745d9f606be27f6405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 18 Oct 2013 14:36:14 +0200 Subject: [PATCH 4/6] Restore the direction=ltr on the MathJax containers. #627 --- unpacked/jax/output/HTML-CSS/jax.js | 1 + unpacked/jax/output/SVG/jax.js | 1 + 2 files changed, 2 insertions(+) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 7653663a1..e881040d8 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -223,6 +223,7 @@ "word-wrap": "normal", "white-space": "nowrap", "float": "none", + "direction": "ltr", border: 0, padding: 0, margin: 0 }, diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index ff5d47efc..7a44aeee0 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -51,6 +51,7 @@ "word-wrap": "normal", "white-space": "nowrap", "float": "none", + "direction": "ltr", border: 0, padding: 0, margin: 0 }, From 3fee31b7e467327937db1cd4e3226dea6423bf84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 21 Oct 2013 10:04:39 +0200 Subject: [PATCH 5/6] Address review comments #627 --- unpacked/jax/element/mml/jax.js | 14 +++++++++++++- unpacked/jax/input/AsciiMath/jax.js | 3 +-- unpacked/jax/input/MathML/jax.js | 7 ++----- unpacked/jax/input/TeX/jax.js | 3 +-- unpacked/jax/output/HTML-CSS/autoload/mglyph.js | 6 ++---- unpacked/jax/output/HTML-CSS/jax.js | 10 +++------- unpacked/jax/output/SVG/autoload/mglyph.js | 2 +- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/unpacked/jax/element/mml/jax.js b/unpacked/jax/element/mml/jax.js index 13e46b7f8..d66d1951f 100644 --- a/unpacked/jax/element/mml/jax.js +++ b/unpacked/jax/element/mml/jax.js @@ -223,7 +223,19 @@ MathJax.ElementJax.mml.Augment({ "fontfamily", "fontsize", "fontweight", "fontstyle", "color", "background", "id", "class", "href", "style" - ] + ], + Error: function (message,def) { + var mml = this.merror(message), + dir = MathJax.Localization.fontDirection(), + font = MathJax.Localization.fontFamily(); + if (def) {mml = mml.With(def)} + if (dir || font) { + mml = this.mstyle(mml); + if (dir) {mml.dir = dir} + if (font) {mml.style.fontFamily = "font-family: "+font} + } + return mml; + } }); (function (MML) { diff --git a/unpacked/jax/input/AsciiMath/jax.js b/unpacked/jax/input/AsciiMath/jax.js index 9e31d10b3..1d19bda5b 100644 --- a/unpacked/jax/input/AsciiMath/jax.js +++ b/unpacked/jax/input/AsciiMath/jax.js @@ -1292,8 +1292,7 @@ junk = null; formatError: function (err,math,script) { var message = err.message.replace(/\n.*/,""); MathJax.Hub.signal.Post(["AsciiMath Jax - parse error",message,math,script]); - var mml = MML.merror(message); - return (MathJax.Localization.fontDirection() ? MML.mstyle(mml).With({dir: "rtl"}) : mml); + return MML.Error(message); }, 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 eec45be2b..22b2f53da 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -77,9 +77,7 @@ mml = this.TeXAtom(match[2]); } else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) { MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]); - var err = MML.merror(_("UnknownNodeType","Unknown node type: %1",type)); - if (MathJax.Localization.fontDirection()) {err = MML.mstyle(err).With({dir: "rtl"})}; - return err; + return MML.Error(_("UnknownNodeType","Unknown node type: %1",type)); } else { mml = MML[type](); } @@ -269,8 +267,7 @@ formatError: function (err,math,script) { var message = err.message.replace(/\n.*/,""); MathJax.Hub.signal.Post(["MathML Jax - parse error",message,math,script]); - var mml = MML.merror(message); - return (MathJax.Localization.fontDirection() ? MML.mstyle(mml).With({dir: "rtl"}) : mml); + return MML.Error(message); }, Error: function (message) { // diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 974ef5e91..19bf4e4e7 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -2099,8 +2099,7 @@ formatError: function (err,math,display,script) { var message = err.message.replace(/\n.*/,""); HUB.signal.Post(["TeX Jax - parse error",message,math,display,script]); - var mml = MML.merror(message); - return (MathJax.Localization.fontDirection() ? MML.mstyle(mml).With({dir: "rtl"}) : mml); + return MML.Error(message); }, // diff --git a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js index 5e736d364..12164e473 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js +++ b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js @@ -45,8 +45,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { } else { if (values.alt === "") {values.alt = LOCALE._(["MathML","BadMglyphFont"],"Bad font: %1",font.family)} - err = MML.merror(values.alt).With({mathsize:"75%"}); - if (LOCALE.fontDirection()) {err = MML.mstyle(err).With({dir: "rtl"})}; + err = MML.Error(values.alt).With({mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } @@ -63,10 +62,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { MathJax.Hub.RestartAfter(img.onload); } if (this.img.status !== "OK") { - err = MML.merror( + err = MML.Error( LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) ).With({mathsize:"75%"}); - if (LOCALE.fontDirection()) {err = MML.mstyle(err).With({dir: "rtl"})}; this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } else { diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index e881040d8..6ece947af 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -1724,8 +1724,9 @@ }, HTMLhandleDir: function (span) { - span.style.direction = this.Get("dir"); - return span; + var dir = this.Get("dir",true); // only get value if not the default + if (dir) {span.dir = dir} + return span; }, HTMLhandleColor: function (span) { @@ -2305,7 +2306,6 @@ } this.HTMLhandleSpace(span); this.HTMLhandleColor(span); - this.HTMLhandleDir(span); return span; }, HTMLstretchH: MML.mbase.HTMLstretchH, @@ -2699,10 +2699,6 @@ // Add color (if any) // this.HTMLhandleColor(span); - // - // Add direction (if any) - // - this.HTMLhandleDir(span); // // Make math span be the correct height and depth // diff --git a/unpacked/jax/output/SVG/autoload/mglyph.js b/unpacked/jax/output/SVG/autoload/mglyph.js index 5b904bda9..ea6a5022a 100644 --- a/unpacked/jax/output/SVG/autoload/mglyph.js +++ b/unpacked/jax/output/SVG/autoload/mglyph.js @@ -74,7 +74,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { MathJax.Hub.RestartAfter(img.onload); } if (this.img.status !== "OK") { - err = MML.merror( + err = MML.Error( LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) ).With({mathsize:"75%"}); this.Append(err); svg = err.toSVG(); this.data.pop(); From 28afef1a95ef4e1e707709c13cca3cb2e9a92b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 21 Oct 2013 12:38:26 +0200 Subject: [PATCH 6/6] mglyph messages: pass the def to the MML.Error function. #627 --- unpacked/jax/output/HTML-CSS/autoload/mglyph.js | 6 +++--- unpacked/jax/output/SVG/autoload/mglyph.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js index 12164e473..f210cef77 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js +++ b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js @@ -45,7 +45,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { } else { if (values.alt === "") {values.alt = LOCALE._(["MathML","BadMglyphFont"],"Bad font: %1",font.family)} - err = MML.Error(values.alt).With({mathsize:"75%"}); + err = MML.Error(values.alt,{mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } @@ -63,8 +63,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { } if (this.img.status !== "OK") { err = MML.Error( - LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) - ).With({mathsize:"75%"}); + LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src), + {mathsize:"75%"}); this.Append(err); err.toHTML(span); this.data.pop(); span.bbox = err.HTMLspanElement().bbox; } else { diff --git a/unpacked/jax/output/SVG/autoload/mglyph.js b/unpacked/jax/output/SVG/autoload/mglyph.js index ea6a5022a..dc38074f2 100644 --- a/unpacked/jax/output/SVG/autoload/mglyph.js +++ b/unpacked/jax/output/SVG/autoload/mglyph.js @@ -75,8 +75,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { } if (this.img.status !== "OK") { err = MML.Error( - LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src) - ).With({mathsize:"75%"}); + LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src), + {mathsize:"75%"}); this.Append(err); svg = err.toSVG(); this.data.pop(); } else { var mu = this.SVGgetMu(svg);