GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/165978
Change subject: Don't duplicate displaystyle & scriptlevel in MathML output ...................................................................... Don't duplicate displaystyle & scriptlevel in MathML output I'm not 100% sure that this is the right fix, but it does avoid emitting invalid XML with duplicate attributes. Change-Id: Ief9e5ece73e5813c838c7efe8e89791cc905772c --- M MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js M MathJaxNode/mathjax/unpacked/jax/output/NativeMML/jax.js 2 files changed, 50 insertions(+), 50 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid refs/changes/78/165978/1 diff --git a/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js b/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js index f8f56f1..bff6b2f 100644 --- a/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js +++ b/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js @@ -4,21 +4,21 @@ /************************************************************* * * MathJax/jax/element/mml/jax.js - * + * * Implements the MML ElementJax that holds the internal represetation * of the mathematics on the page. Various InputJax will produce this * format, and the OutputJax will display it in various formats. * * --------------------------------------------------------------------- - * + * * Copyright (c) 2009-2014 The MathJax Consortium - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -221,7 +221,7 @@ }, skipAttributes: {texClass: true, useHeight: true, texprimestyle: true}, copyAttributeNames: [ - "displaystyle", "scriptlevel", "open", "close", "form", // force these to be copied + "open", "close", "form", // force these to be copied "fontfamily", "fontsize", "fontweight", "fontstyle", "color", "background", "id", "class", "href", "style" @@ -254,7 +254,7 @@ texClass: true }, linebreakContainer: false, - + Init: function () { this.data = []; if (this.inferRow && !(arguments.length === 1 && arguments[0].inferred)) @@ -435,7 +435,7 @@ return this; } }); - + MML.mi = MML.mbase.Subclass({ type: "mi", isToken: true, texClass: MML.TEXCLASS.ORD, @@ -466,7 +466,7 @@ return this; } }); - + MML.mn = MML.mbase.Subclass({ type: "mn", isToken: true, texClass: MML.TEXCLASS.ORD, @@ -478,7 +478,7 @@ dir: MML.INHERIT } }); - + MML.mo = MML.mbase.Subclass({ type: "mo", isToken: true, defaults: { @@ -675,7 +675,7 @@ return this; } }); - + MML.mtext = MML.mbase.Subclass({ type: "mtext", isToken: true, isSpacelike: function () {return true}, @@ -1047,7 +1047,7 @@ }, setTeXclass: MML.mbase.setBaseTeXclasses }); - + MML.msub = MML.msubsup.Subclass({type: "msub"}); MML.msup = MML.msubsup.Subclass({type: "msup", sub:2, sup:1}); MML.mmultiscripts = MML.msubsup.Subclass({ @@ -1059,7 +1059,7 @@ }); MML.mprescripts = MML.mbase.Subclass({type: "mprescripts"}); MML.none = MML.mbase.Subclass({type: "none"}); - + MML.munderover = MML.mbase.Subclass({ type: "munderover", base: 0, under: 1, over: 2, sub: 1, sup: 2, @@ -1103,7 +1103,7 @@ }, setTeXclass: MML.mbase.setBaseTeXclasses }); - + MML.munder = MML.munderover.Subclass({type: "munder"}); MML.mover = MML.munderover.Subclass({ type: "mover", over: 1, under: 2, sup: 1, sub: 2, @@ -1231,7 +1231,7 @@ MML.mlabeledtr = MML.mtr.Subclass({ type: "mlabeledtr" }); - + MML.maction = MML.mbase.Subclass({ type: "maction", defaults: { @@ -1253,7 +1253,7 @@ return this.selected().setTeXclass(prev); } }); - + MML.semantics = MML.mbase.Subclass({ type: "semantics", notParent: true, isEmbellished: MML.mbase.childEmbellished, @@ -1345,14 +1345,14 @@ return this.data[0].getAnnotation(name); } }); - + MML.chars = MML.mbase.Subclass({ type: "chars", Append: function () {this.data.push.apply(this.data,arguments)}, value: function () {return this.data.join("")}, toString: function () {return this.data.join("")} }); - + MML.entity = MML.mbase.Subclass({ type: "entity", Append: function () {this.data.push.apply(this.data,arguments)}, @@ -1369,7 +1369,7 @@ + String.fromCharCode((n&0x3FF)+0xDC00); } }); - + MML.xml = MML.mbase.Subclass({ type: "xml", Init: function () { @@ -1412,7 +1412,7 @@ value: function () {return this.div}, toString: function () {return this.div.innerHTML} }); - + MML.TeXAtom = MML.mbase.Subclass({ type: "texatom", inferRow: true, notParent: true, @@ -1426,11 +1426,11 @@ }, adjustTeXclass: MML.mo.prototype.adjustTeXclass }); - + MML.NULL = MML.mbase().With({type:"null"}); var TEXCLASS = MML.TEXCLASS; - + var MO = { ORD: [0,0,TEXCLASS.ORD], ORD11: [1,1,TEXCLASS.ORD], @@ -1751,7 +1751,7 @@ },{ OPTYPES: MO }); - + // // These are not in the W3C table, but FF works this way, // and it makes sense, so add it here @@ -1763,7 +1763,7 @@ OPTABLE.prefix["\u2225"] = MO.OPEN; OPTABLE.postfix["\u2223"] = MO.CLOSE; OPTABLE.postfix["\u2225"] = MO.CLOSE; - + })(MathJax.ElementJax.mml); MathJax.ElementJax.mml.loadComplete("jax.js"); diff --git a/MathJaxNode/mathjax/unpacked/jax/output/NativeMML/jax.js b/MathJaxNode/mathjax/unpacked/jax/output/NativeMML/jax.js index dd87723..45fbc74 100644 --- a/MathJaxNode/mathjax/unpacked/jax/output/NativeMML/jax.js +++ b/MathJaxNode/mathjax/unpacked/jax/output/NativeMML/jax.js @@ -7,17 +7,17 @@ * * Implements the NativeMML OutputJax that displays mathematics * using a browser's native MathML capabilities (if any). - * + * * --------------------------------------------------------------------- - * + * * Copyright (c) 2010-2014 The MathJax Consortium - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,11 +27,11 @@ (function (nMML,HUB,AJAX,HTML) { var MML, isMSIE = HUB.Browser.isMSIE; - + var EVENT, TOUCH, HOVER, ZOOM; // filled in later HUB.Register.StartupHook("MathZoom Ready",function () {ZOOM = MathJax.Extension.MathZoom}); - + var NOPADDING = function (side,obj) { var span = HTML.Element("span"); side = "padding"+side; if (obj) { @@ -41,7 +41,7 @@ } } }; - + var CELLSPACING = function (obj,rowSpacing,columnSpacing) { // // Webkit default padding on mtd cells is simply @@ -79,7 +79,7 @@ obj.setAttribute("style",span.style.cssText); } }; - + nMML.Augment({ // // User can configure styles @@ -105,15 +105,15 @@ "min-width": 0, "min-height": 0, border: 0, padding: 0, margin: 0 }, - + "span.MathJax_MathML": { display: "inline!important" }, - + "div.MathJax_MathML": { display: "block!important" }, - + ".MathJax_mmlExBox": { display:"block!important", overflow:"hidden", height:"1px", width:"60ex", @@ -126,7 +126,7 @@ settings: HUB.config.menuSettings, ex: 1, scale: 1, // filled in later adjustWidths: [], // array of elements to have their widths adjusted - + Config: function () { this.SUPER(arguments).Config.call(this); if (this.settings.scale) {this.config.scale = this.settings.scale} @@ -221,7 +221,7 @@ document.body.removeChild(this.EmExSpan); } }, - + preTranslate: function (state) { var scripts = state.jax[this.id], i, m = scripts.length, script, prev, span, test, math, jax, ex, mex, scale; @@ -286,7 +286,7 @@ // // Add a SPAN to use as a container, and render the math into it - // + // Translate: function (script) { if (!script.parentNode) return; // @@ -343,7 +343,7 @@ sheet.disabled = true; sheet.disabled = false; } }, - + // // Remove MathML preceeding the script // @@ -540,13 +540,13 @@ return math; } }); - + MML.mrow.Augment({ // // Make inferred rows not include an mrow tag // toNativeMML: function (parent) { - var i, m; + var i, m; if (this.inferred && this.parent.inferRow) { for (i = 0, m = this.data.length; i < m; i++) { if (this.data[i]) {this.data[i].toNativeMML(parent)} @@ -827,7 +827,7 @@ parent.appendChild(mtr); } }); - + MML.mtd.Augment({ toNativeMML: function (parent) { var tag = parent.appendChild(this.NativeMMLelement(this.type)); @@ -842,7 +842,7 @@ } } }); - + MML.mspace.Augment({ toNativeMML: function (parent) { this.SUPER(arguments).toNativeMML.call(this,parent); @@ -915,7 +915,7 @@ }); } } - + MML.math.Augment({ toNativeMML: function (parent,jax) { var tag = this.NativeMMLelement(this.type), math = tag; @@ -975,7 +975,7 @@ parent.appendChild(math); // // Firefox can't seem to get the width of <math> elements right, so - // use an <mrow> to get the actual width and set the style on the + // use an <mrow> to get the actual width and set the style on the // parent element to match. Even if we set the <math> width properly, // it doesn't seem to propagate up to the <span> correctly. // @@ -1086,7 +1086,7 @@ if (!isOpera) { // // Append the opening fence - // + // operator = this.NativeMMLelement("mo"); operator.setAttribute("fence", "true"); operator.textContent = values.open; @@ -1152,7 +1152,7 @@ parent.appendChild(document.createTextNode(this.toString())); } }); - + MML.xml.Augment({ // // Insert the XML verbatim @@ -1312,7 +1312,7 @@ // setTimeout(MathJax.Callback(["loadComplete",nMML,"jax.js"]),0); }); - + // // Determine browser characteristics @@ -1362,7 +1362,7 @@ nMML.mmultiscriptsBug = true; } }); - + HUB.Register.StartupHook("End Cookie",function () { if (HUB.config.menuSettings.zoom !== "None") -- To view, visit https://gerrit.wikimedia.org/r/165978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief9e5ece73e5813c838c7efe8e89791cc905772c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mathoid Gerrit-Branch: master Gerrit-Owner: GWicke <gwi...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits