From 593a393bfc6d551c0e659c2d230d995136c49210 Mon Sep 17 00:00:00 2001 From: Peter Krautzberger Date: Fri, 4 Sep 2015 10:21:34 +0200 Subject: [PATCH 01/19] Improve RTL support in HTML-CSS Add CSS to prevent browser interference --- unpacked/extensions/MathML/mml3.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js index 575953eea..e3a4eb3e1 100644 --- a/unpacked/extensions/MathML/mml3.js +++ b/unpacked/extensions/MathML/mml3.js @@ -121,6 +121,9 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { // No XSLT support. Do not change the content. MATHML.mml3XSLT = null; } + + // Tweak CSS to avoid some browsers rearranging HTML output + MathJax.Ajax.Styles(".MathJax span { direction: ltr !important; display: inline-block !important;}"); MathJax.Hub.Startup.signal.Post("MathML mml3.js Ready"); }); From 98a8deecf6228b8fb7c5ed4c0aba402756bc6a3d Mon Sep 17 00:00:00 2001 From: Peter Krautzberger Date: Wed, 9 Sep 2015 11:40:23 +0200 Subject: [PATCH 02/19] Update MathJax.js: add UA detection for MS Edge Cf. https://msdn.microsoft.com/en-us/library/hh869301.aspx --- unpacked/MathJax.js | 1 + 1 file changed, 1 insertion(+) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 30ce40297..a8b6dbeb3 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -3090,6 +3090,7 @@ MathJax.Hub.Startup = { isMac: (navigator.platform.substr(0,3) === "Mac"), isPC: (navigator.platform.substr(0,3) === "Win"), isMSIE: ("ActiveXObject" in window && "clipboardData" in window), + isMsEdge: (!!AGENT.match(/Edge\//)), isFirefox: (!!AGENT.match(/Gecko\//) && !AGENT.match(/like Gecko/)), isSafari: (!!AGENT.match(/ (Apple)?WebKit\//) && !AGENT.match(/ like iPhone /) && (!window.chrome || window.chrome.loadTimes == null)), From 2c79bd40909162b08672f735636b53017301d852 Mon Sep 17 00:00:00 2001 From: Peter Krautzberger Date: Wed, 9 Sep 2015 11:45:59 +0200 Subject: [PATCH 03/19] Update mml3.js Fixes #1252. * Add workaround for MS Edge bug. * Prettify xslt string. --- unpacked/extensions/MathML/mml3.js | 652 ++++++++++++++++++++++++++++- 1 file changed, 648 insertions(+), 4 deletions(-) diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js index e3a4eb3e1..78678cd3d 100644 --- a/unpacked/extensions/MathML/mml3.js +++ b/unpacked/extensions/MathML/mml3.js @@ -72,17 +72,661 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { }); /* - * The following is taken from mml3mj.xsl - * (https://web-xslt.googlecode.com/svn/trunk/ctop/mml3mj.xsl) + * The following is derived from mml3mj.xsl + * (https://github.com/davidcarlisle/web-xslt/blob/master/ctop/mml3mj.xsl) * which is Copyright (c) David Carlisle 2008-2015. * It is used by permission of David Carlisle, who has agreed to allow it to * be released under the Apache License, Version 2.0. */ - var mml3Stylesheet = ' this[\'node-set\'] = function (x) { return x; })(][}{)(][}{\)(}{><top right 0decimalpoint decimalpoint.decimalpoint*0.1em0.15em0.2em0.15em0)(/\\:=top)'; + var BROWSER = MathJax.Hub.Browser; + var exslt = ''; + if (BROWSER.isMsEdge) { + exslt = 'urn:schemas-microsoft-com:xslt' + } else { + exslt = 'http://exslt.org/common'; + } + var mml3Stylesheet = + '' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + '' + + ' ' + + ' ltr' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + '' + + ' )' + + '' + + ' (' + + '' + + '' + + ' ]' + + '' + + '' + + ' [' + + '' + + '' + + ' }' + + '' + + '' + + ' {' + + '' + + '' + + ' ' + + '' + + ' )' + + '' + + ' (' + + '' + + '' + + ' ]' + + '' + + '' + + ' [' + + '' + + '' + + ' }' + + '' + + '' + + ' {' + + '' + + ' ' + + ' ' + + ' \' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ')' + + '(' + + '}' + + '{' + + '>' + + '<' + + '' + + '' + + '' + + ' top right' + + '' + + '' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 0' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' decimalpoint' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' decimalpoint' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' .' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' decimalpoint' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' *' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 0.1em' + + ' 0.15em' + + ' 0.2em' + + ' ' + + ' 0.15em' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 0' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' )' + + ' ' + + ' (' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' /' + + ' ' + + ' \' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' :' + + ' ' + + ' =' + + ' ' + + ' ' + + ' ' + + ' ' + + ' top' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' )' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ''; + /* * End of mml3mj.xsl material. */ - + var mml3; if (window.XSLTProcessor) { // standard method: just use an XSLTProcessor and parse the stylesheet From bbdbe19eda28f709c1afc9c41813598e933a7d53 Mon Sep 17 00:00:00 2001 From: Peter Krautzberger Date: Wed, 9 Sep 2015 17:33:59 +0200 Subject: [PATCH 04/19] update mml3.js Extend Microsoft Edge workaround to Internet Explorer. --- unpacked/extensions/MathML/mml3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js index 78678cd3d..f14e3bff9 100644 --- a/unpacked/extensions/MathML/mml3.js +++ b/unpacked/extensions/MathML/mml3.js @@ -80,7 +80,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { */ var BROWSER = MathJax.Hub.Browser; var exslt = ''; - if (BROWSER.isMsEdge) { + if (BROWSER.isMsEdge || BROWSER.isMSIE) { exslt = 'urn:schemas-microsoft-com:xslt' } else { exslt = 'http://exslt.org/common'; From 3a15f830592f4825f548c91699592da545cd0a5f Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Fri, 11 Sep 2015 10:44:50 -0400 Subject: [PATCH 05/19] Adjust role for SVG output and put aria-label on the SVG element rather than the enclosing span; add role and aria-label to CHTML output. Resolves issue #1192. --- unpacked/jax/output/CommonHTML/jax.js | 3 +++ unpacked/jax/output/SVG/jax.js | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index 65fa68910..20420ca51 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -1666,6 +1666,9 @@ MML.math.Augment({ toCommonHTML: function (node) { node = this.CHTMLdefaultNode(node); + var alttext = this.Get("alttext"); + if (alttext && !node.getAttribute("aria-label")) node.setAttribute("aria-label",alttext); + if (!node.getAttribute("role")) node.setAttribute("role","math"); if (this.CHTML.pwidth) { node.parentNode.style.width = this.CHTML.pwidth; node.parentNode.style.minWidth = this.CHTML.mwidth; diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 1718cc829..c273f3a9d 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -2100,9 +2100,8 @@ // Add it to the MathJax span // var alttext = this.Get("alttext"); - if (alttext && !svg.element.getAttribute("aria-label")) span.setAttribute("aria-label",alttext); - if (!svg.element.getAttribute("role")) span.setAttribute("role","math"); -// span.setAttribute("tabindex",0); // causes focus outline, so disable for now + if (alttext && !svg.element.getAttribute("aria-label")) svg.element.setAttribute("aria-label",alttext); + if (!svg.element.getAttribute("role")) svg.element.setAttribute("role","img"); span.appendChild(svg.element); svg.element = null; // From e172b049280b268680fa21b32c6384965f0d67b4 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 12 Sep 2015 13:23:29 -0400 Subject: [PATCH 06/19] Use less-aggressive CSS for ltr and inline-block, and do Edge check within the extension. --- unpacked/MathJax.js | 1 - unpacked/extensions/MathML/mml3.js | 13 +++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index a8b6dbeb3..30ce40297 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -3090,7 +3090,6 @@ MathJax.Hub.Startup = { isMac: (navigator.platform.substr(0,3) === "Mac"), isPC: (navigator.platform.substr(0,3) === "Win"), isMSIE: ("ActiveXObject" in window && "clipboardData" in window), - isMsEdge: (!!AGENT.match(/Edge\//)), isFirefox: (!!AGENT.match(/Gecko\//) && !AGENT.match(/like Gecko/)), isSafari: (!!AGENT.match(/ (Apple)?WebKit\//) && !AGENT.match(/ like iPhone /) && (!window.chrome || window.chrome.loadTimes == null)), diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js index f14e3bff9..27eac324e 100644 --- a/unpacked/extensions/MathML/mml3.js +++ b/unpacked/extensions/MathML/mml3.js @@ -80,7 +80,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { */ var BROWSER = MathJax.Hub.Browser; var exslt = ''; - if (BROWSER.isMsEdge || BROWSER.isMSIE) { + if (!!navigator.userAgent.match(/ Edge\//) || BROWSER.isMSIE) { exslt = 'urn:schemas-microsoft-com:xslt' } else { exslt = 'http://exslt.org/common'; @@ -767,7 +767,16 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { } // Tweak CSS to avoid some browsers rearranging HTML output - MathJax.Ajax.Styles(".MathJax span { direction: ltr !important; display: inline-block !important;}"); + MathJax.Ajax.Styles({ + ".MathJax .mi, .MathJax .mo, .MathJax .mn, .MathJax .mtext": { + direction: "ltr", + display: "inline-block" + }, + ".MathJax .ms, .MathJax .mspace, .MathJax .mglyph": { + direction: "ltr", + display: "inline-block" + } + }); MathJax.Hub.Startup.signal.Post("MathML mml3.js Ready"); }); From 17e02d710c9d700ef7d685ab4241938090690de7 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 12 Sep 2015 14:19:37 -0400 Subject: [PATCH 07/19] Fix removal of previously rendered CHTML output (for Rerender, etc) to lok for class rather than node type, now that we switched to all spans again (sigh). --- unpacked/jax/output/CommonHTML/jax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index 20420ca51..eba9c5d22 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -360,7 +360,7 @@ // Remove any existing output // prev = script.previousSibling; - if (prev && prev.nodeName.toLowerCase() === "mjx-chtml") + if (prev && prev.className.substr(0,9) === "mjx-chtml") prev.parentNode.removeChild(prev); // // Add the node for the math and mark it as being processed From 0412d8ec7e3d388be6dc726eec3f474bd77070f8 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 12 Sep 2015 14:23:35 -0400 Subject: [PATCH 08/19] Fixed CHTML.addElement to be able to create non-span elements (e.g., the needed for href attributes) --- unpacked/jax/output/CommonHTML/jax.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index eba9c5d22..54863d260 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -324,8 +324,9 @@ if (type.substr(0,4) === "mjx-") { if (!def) def = {}; if (def.className) def.className = type+" "+def.className; else def.className = type; + type = "span"; } - return this.HTMLElement("span",def,content); + return this.HTMLElement(type,def,content); }, addElement: function (node,type,def,content) { return node.appendChild(this.Element(type,def,content)); From 649b7b2863f74eafd35acdbb4b35a353fa14f200 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 12 Sep 2015 15:00:06 -0400 Subject: [PATCH 09/19] Properly handle left-hand space for first script after in CHTML mmultiscripts --- unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js b/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js index e412a1c91..f19a15e5d 100644 --- a/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js +++ b/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js @@ -182,7 +182,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { BBOX = state.BBOX[type] = CHTML.BBOX.empty(); if (state.w) { BOX.style.paddingLeft = CHTML.Em(state.w); - BBOX.w = BBOX.r = state.w; + BBOX.w = BBOX.r = state.w; BBOX.x = state.w; } } data.toCommonHTML(BOX); @@ -198,7 +198,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { // right-justify the scripts, otherwise, left-justify them. // CHTMLpadScript: function (type,w,bbox,state) { - if (!bbox) bbox = {w:0, fake:1}; + if (!bbox) bbox = {w:0, fake:1, rscale:1}; var BBOX = state.BBOX[type], dx = 0, dw = 0; if (BBOX) { if (bbox.rscale*bbox.w < w) { @@ -252,7 +252,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { CHTMLplaceSubSup: function (sub,sbox,sup,Sbox,x,delta,u,v,s) { sub.style.paddingRight = CHTML.Em(s); sbox.w += s; sup.style.paddingBottom = CHTML.Em(u+v-Sbox.d-sbox.h); - sup.style.paddingLeft = CHTML.Em(delta); + sup.style.paddingLeft = CHTML.Em(delta+(Sbox.x||0)); sup.style.paddingRight = CHTML.Em(s); Sbox.w += s; sup.parentNode.style.verticalAlign = CHTML.Em(-v); this.CHTML.combine(sbox,x,-v); @@ -272,7 +272,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { CHTMLplacePresubPresup: function (presub,pbox,presup,Pbox,delta,u,v,s) { presub.style.paddingLeft = CHTML.Em(s); presup.style.paddingBottom = CHTML.Em(u+v-Pbox.d-pbox.h); - presup.style.paddingLeft = CHTML.Em(delta+s); + presup.style.paddingLeft = CHTML.Em(delta+s+(Pbox.x||0)); presup.style.paddingRight = CHTML.Em(-delta); presup.parentNode.style.verticalAlign = CHTML.Em(-v); this.CHTML.combine(pbox,s,-v); From f54168eed325f881d6ba304a2c23c8a152cd20ff Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 12 Sep 2015 15:09:01 -0400 Subject: [PATCH 10/19] Fix spacing for eqnarray environment now that it is handled in AMSarray --- unpacked/extensions/TeX/AMSmath.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index 545135362..c6d974b21 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -134,14 +134,14 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { aligned: ['AlignedAMSArray',null,null,null,'rlrlrlrlrlrl',COLS([0,2,0,2,0,2,0,2,0,2,0]),".5em",'D'], gathered: ['AlignedAMSArray',null,null,null,'c',null,".5em",'D'], - subarray: ['Array',null,null,null,null,COLS([0,0,0,0]),"0.1em",'S',1], + subarray: ['Array',null,null,null,null,COLS([0]),"0.1em",'S',1], smallmatrix: ['Array',null,null,null,'c',COLS([1/3]),".2em",'S',1], 'equation': ['EquationBegin','Equation',true], 'equation*': ['EquationBegin','EquationStar',false], - eqnarray: ['AMSarray',null,true,true, 'rcl',MML.LENGTH.THICKMATHSPACE,".5em"], - 'eqnarray*': ['AMSarray',null,false,true,'rcl',MML.LENGTH.THICKMATHSPACE,".5em"] + eqnarray: ['AMSarray',null,true,true, 'rcl',COLS([0]),".5em"], + 'eqnarray*': ['AMSarray',null,false,true,'rcl',COLS([0]),".5em"] }, delimiter: { From 620e303b1096f4936c9c5c1882c8f70758f82827 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 13 Sep 2015 10:57:34 -0400 Subject: [PATCH 11/19] Detect Microsoft Edge, and also set isMobile for Window Phone --- unpacked/MathJax.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index f81670339..e1a1900bc 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -3092,11 +3092,13 @@ MathJax.Hub.Startup = { isMac: (navigator.platform.substr(0,3) === "Mac"), isPC: (navigator.platform.substr(0,3) === "Win"), isMSIE: ("ActiveXObject" in window && "clipboardData" in window), + isEdge: ("MSGestureEvent" in window && "chrome" in window && + window.chrome.loadTimes == null), isFirefox: (!!AGENT.match(/Gecko\//) && !AGENT.match(/like Gecko/)), isSafari: (!!AGENT.match(/ (Apple)?WebKit\//) && !AGENT.match(/ like iPhone /) && - (!window.chrome || window.chrome.loadTimes == null)), - isChrome: (window.chrome != null && window.chrome.loadTimes != null), - isOpera: (window.opera != null && window.opera.version != null), + (!window.chrome || window.chrome.app == null)), + isChrome: ("chrome" in window && window.chrome.loadTimes != null), + isOpera: ("opera" in window && window.opera.version != null), isKonqueror: ("konqueror" in window && navigator.vendor == "KDE"), versionAtLeast: function (v) { var bv = (this.version).split('.'); v = (new String(v)).split('.'); @@ -3124,7 +3126,7 @@ MathJax.Hub.Startup = { HUB.Browser = HUB.Insert(new String(browser),BROWSERS); var VERSION = new RegExp( ".*(Version/| Trident/.*; rv:)((?:\\d+\\.)+\\d+)|" + // for Safari, Opera10, and IE11+ - ".*("+browser+")"+(browser == "MSIE" ? " " : "/")+"((?:\\d+\\.)*\\d+)|"+ // for one of the main browser + ".*("+browser+")"+(browser == "MSIE" ? " " : "/")+"((?:\\d+\\.)*\\d+)|"+ // for one of the main browsers "(?:^|\\(| )([a-z][-a-z0-9._: ]+|(?:Apple)?WebKit)/((?:\\d+\\.)+\\d+)"); // for unrecognized browser var MATCH = VERSION.exec(xAGENT) || ["","","","unknown","0.0"]; HUB.Browser.name = (MATCH[1] != "" ? browser : (MATCH[3] || MATCH[5])); @@ -3179,7 +3181,11 @@ MathJax.Hub.Startup = { AGENT.match(/Mobile/) != null); }, Opera: function (browser) {browser.version = opera.version()}, + Edge: function (browser) { + browser.isMobile = !!navigator.userAgent.match(/ Phone/); + }, MSIE: function (browser) { + browser.isMobile = !!navigator.userAgent.match(/ Phone/); browser.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance)); MathJax.HTML.setScriptBug = !browser.isIE9 || document.documentMode < 9; MathJax.Hub.msieHTMLCollectionBug = (document.documentMode < 9); From 79bd8996edb66d5492140fa6cd224ac395c8979c Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 13 Sep 2015 11:09:55 -0400 Subject: [PATCH 12/19] Add warning when switching to NativeMML in Edge --- unpacked/extensions/MathMenu.js | 1 + 1 file changed, 1 insertion(+) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 48d9c020f..c1f7009d1 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -1213,6 +1213,7 @@ if (BROWSER.isChrome && BROWSER.version.substr(0,3) !== "24.") {message = MESSAGE.MML.WebKit} else if (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0")) {message = MESSAGE.MML.WebKit} else if (BROWSER.isMSIE) {if (!BROWSER.hasMathPlayer) {message = MESSAGE.MML.MSIE}} + else if (BROWSER.isEdge) {message = MESSAGE.MML.WebKit} else {message = MESSAGE.MML[BROWSER]} warned = "warnedMML"; } From 104434c674410da082b0e879896d74cb959a49fb Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 13 Sep 2015 11:27:54 -0400 Subject: [PATCH 13/19] Add mobile detection for Chrome and enable alternate context menu trigger (double-tap and hold) --- unpacked/MathJax.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index e1a1900bc..ccee686ca 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -3180,6 +3180,9 @@ MathJax.Hub.Startup = { AGENT.match(/ Fennec\//) != null || AGENT.match(/Mobile/) != null); }, + Chrome: function (browser) { + browser.noContextMenu = browser.isMobile = !!navigator.userAgent.match(/ Mobile[ \/]/); + }, Opera: function (browser) {browser.version = opera.version()}, Edge: function (browser) { browser.isMobile = !!navigator.userAgent.match(/ Phone/); From 031dccee981ab707f8412660f623e0589659bb0f Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 13 Sep 2015 17:48:29 -0400 Subject: [PATCH 14/19] Fix CHTML issues due to change from custom tags to span-with-class approach (i.e., replace uses of getElementsByTagName). Also fix some issues found by running the test suite. --- .../CommonHTML/autoload/mmultiscripts.js | 10 +++--- .../output/CommonHTML/autoload/multiline.js | 18 +++++------ unpacked/jax/output/CommonHTML/jax.js | 32 ++++++++++++++----- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js b/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js index f19a15e5d..1a1914e17 100644 --- a/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js +++ b/unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js @@ -45,7 +45,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { // var base, bbox; if (stretch) { - base = node.getElementsByTagName("mjx-base")[0]; + base = CHTML.getNode(node,"mjx-base"); } else { this.CHTMLaddChild(node,0,{type:"mjx-base", noBBox:true, forceChild:true}); base = node.firstChild; @@ -137,10 +137,10 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { // CHTMLgetScripts: function (BOX,BBOX,stretch,node) { if (stretch) { - BOX.sub = node.getElementsByTagName("mjx-sub")[0]; - BOX.sup = node.getElementsByTagName("mjx-sup")[0]; - BOX.presub = node.getElementsByTagName("mjx-presub")[0]; - BOX.presup = node.getElementsByTagName("mjx-presup")[0]; + BOX.sub = CHTML.getNode(node,"mjx-sub"); + BOX.sup = CHTML.getNode(node,"mjx-sup"); + BOX.presub = CHTML.getNode(node,"mjx-presub"); + BOX.presup = CHTML.getNode(node,"mjx-presup"); BBOX.sub = this.CHTMLbbox.sub; BBOX.sup = this.CHTMLbbox.sup; BBOX.presub = this.CHTMLbbox.presub; diff --git a/unpacked/jax/output/CommonHTML/autoload/multiline.js b/unpacked/jax/output/CommonHTML/autoload/multiline.js index 3b30c07f4..fcccc549a 100644 --- a/unpacked/jax/output/CommonHTML/autoload/multiline.js +++ b/unpacked/jax/output/CommonHTML/autoload/multiline.js @@ -505,9 +505,9 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { // if (end.length === 0) { var NODE = this.CHTMLnodeElement(), - stack = NODE.getElementsByTagName("mjx-stack")[0], - sup = NODE.getElementsByTagName("mjx-sup")[0], - sub = NODE.getElementsByTagName("mjx-sub")[0]; + stack = CHTML.getNode(NODE,"mjx-stack"), + sup = CHTML.getNode(NODE,"mjx-sup"), + sub = CHTML.getNode(NODE,"mjx-sub"); if (stack) node.appendChild(stack); else if (sup) node.appendChild(sup); else if (sub) node.appendChild(sub); @@ -569,9 +569,9 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { // if (start.length < 1) { NODE = this.CHTMLnodeElement(); - var prestack = NODE.getElementsByTagName("mjx-prestack")[0], - presup = NODE.getElementsByTagName("mjx-presup")[0], - presub = NODE.getElementsByTagName("mjx-presub")[0]; + var prestack = CHTML.getNode(NODE,"mjx-prestack"), + presup = CHTML.getNode(NODE,"mjx-presup"), + presub = CHTML.getNode(NODE,"mjx-presub"); if (prestack) node.appendChild(prestack); else if (presup) node.appendChild(presup); else if (presub) node.appendChild(presub); @@ -598,9 +598,9 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () { // if (end.length === 0) { NODE = this.CHTMLnodeElement(); - var stack = NODE.getElementsByTagName("mjx-stack")[0], - sup = NODE.getElementsByTagName("mjx-sup")[0], - sub = NODE.getElementsByTagName("mjx-sub")[0]; + var stack = CHTML.getNode(NODE,"mjx-stack"), + sup = CHTML.getNode(NODE,"mjx-sup"), + sub = CHTML.getNode(NODE,"mjx-sub"); if (stack) node.appendChild(stack); else if (sup) node.appendChild(sup); else if (sub) node.appendChild(sub); diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index 54863d260..b51900f06 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -335,6 +335,22 @@ ucMatch: HTML.ucMatch, setScript: HTML.setScript, + // + // This replaces node.getElementsByTagName(type)[0] + // and should be replaced by that if we go back to using + // custom tags + // + getNode: (document.getElementsByClassName ? + function (node,type) {return node.getElementsByClassName(type)[0]} : + function (node,type) { + var nodes = node.getElementsByTagName("span"); + var name = RegExp("\\b"+type+"\\b"); + for (var i = 0, m = nodes.length; i < m; i++) { + if (name.test(nodes[i].className)) return nodes[i]; + } + } + ), + /********************************************/ @@ -361,7 +377,7 @@ // Remove any existing output // prev = script.previousSibling; - if (prev && prev.className.substr(0,9) === "mjx-chtml") + if (prev && prev.className && String(prev.className).substr(0,9) === "mjx-chtml") prev.parentNode.removeChild(prev); // // Add the node for the math and mark it as being processed @@ -1328,7 +1344,7 @@ if (child) { var type = options.childNodes; if (type) { - if (type instanceof Array) type = type[i]; + if (type instanceof Array) type = type[i]||"span"; node = CHTML.addElement(node,type); } cnode = child.toCommonHTML(node,options.childOptions); @@ -2035,9 +2051,9 @@ // var base, under, over, nodes = []; if (stretch) { - base = node.getElementsByTagName("mjx-op")[0]; - under = node.getElementsByTagName("mjx-under")[0]; - over = node.getElementsByTagName("mjx-over")[0]; + base = CHTML.getNode(node,"mjx-op"); + under = CHTML.getNode(node,"mjx-under"); + over = CHTML.getNode(node,"mjx-over"); nodes[0] = base; nodes[1] = under||over; nodes[2] = over; } else { var types = ["mjx-op","mjx-under","mjx-over"]; @@ -2235,9 +2251,9 @@ // var base, sub, sup; if (stretch) { - base = node.getElementsByTagName("mjx-base")[0]; - sub = node.getElementsByTagName("mjx-sub")[0]; - sup = node.getElementsByTagName("mjx-sup")[0]; + base = CHTML.getNode(node,"mjx-base"); + sub = CHTML.getNode(node,"mjx-sub"); + sup = CHTML.getNode(node,"mjx-sup"); } else { var types = ["mjx-base","mjx-sub","mjx-sup"]; if (this.sup === 1) types[1] = types[2]; From 3e190fc5f4f593d4344d932064b674231ebc2142 Mon Sep 17 00:00:00 2001 From: zorkow Date: Mon, 14 Sep 2015 01:28:13 +0100 Subject: [PATCH 15/19] Adds additional aria elements for the menu items. --- unpacked/extensions/MathMenu.js | 45 ++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 48d9c020f..8bcbd0163 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -598,11 +598,13 @@ {onmouseup: MENU.Mouseup, ondragstart: FALSE, onselectstart: FALSE, onselectend: FALSE, ontouchstart: MENU.Touchstart, ontouchend: MENU.Touchend, - className: "MathJax_MenuItem", menuItem: this}, + className: "MathJax_MenuItem", role: this.role, + menuItem: this}, def); }, Create: function (menu) { + console.log('create'); if (!this.hidden) { var def = this.Attributes(); var label = this.Label(def,menu); @@ -679,14 +681,12 @@ * Abstract class of menu items that are focusable and perform some action */ MENU.ENTRY = MENU.ITEM.Subclass({ - role: "menuitem", // Aria role. Attributes: function(def) { def = HUB.Insert( {onmouseover: MENU.Mouseover, onmouseout: MENU.Mouseout, - onmousedown: MENU.Mousedown, role: this.role, - onkeydown: MENU.Keydown, + onmousedown: MENU.Mousedown, onkeydown: MENU.Keydown, "aria-disabled": !!this.disabled}, def); def = this.SUPER(arguments).Attributes.call(this, def); @@ -798,6 +798,11 @@ marker: "\u25BA", // the submenu arrow markerRTL: "\u25C4", // the submenu arrow for RTL + Attributes: function(def) { + def = HUB.Insert({"aria-haspopup": "true"}, def); + def = this.SUPER(arguments).Attributes.call(this, def); + return def; + }, Init: function (name,def) { if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; var i = 1; @@ -891,6 +896,13 @@ marker: (isPC ? "\u25CF" : "\u2713"), // the checkmark role: "menuitemradio", + Attributes: function(def) { + if (CONFIG.settings[this.variable] === this.value) { + def = HUB.Insert({"aria-checked": "true"}, def); + } + def = this.SUPER(arguments).Attributes.call(this, def); + return def; + }, Init: function (name,variable,def) { if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; this.variable = variable; this.With(def); @@ -898,19 +910,24 @@ }, Label: function (def,menu) { var span = {className:"MathJax_MenuRadioCheck" + this.rtlClass()}; - if (CONFIG.settings[this.variable] !== this.value) {span = {style:{display:"none"}}} + if (CONFIG.settings[this.variable] !== this.value) { + span = {style:{display:"none"}}; + } return [["span",span,[this.marker]]," "+this.Name()]; }, Mouseup: function (event,menu) { + console.log(menu); if (!this.disabled) { var child = menu.parentNode.childNodes; for (var i = 0, m = child.length; i < m; i++) { var item = child[i].menuItem; - if (item && item.variable === this.variable) - {child[i].firstChild.style.display = "none"} + if (item && item.variable === this.variable) { + child[i].firstChild.style.display = "none"; + } } menu.firstChild.display = ""; CONFIG.settings[this.variable] = this.value; + console.log('Changing'); MENU.cookie[this.variable] = CONFIG.settings[this.variable]; MENU.saveCookie(); SIGNAL.Post(["radio button",this]); } @@ -929,6 +946,13 @@ marker: "\u2713", // the checkmark role: "menuitemcheckbox", + Attributes: function(def) { + if (CONFIG.settings[this.variable]) { + def = HUB.Insert({"aria-checked": "true"}, def); + } + def = this.SUPER(arguments).Attributes.call(this, def); + return def; + }, Init: function (name,variable,def) { if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair this.name = name; this.variable = variable; this.With(def); @@ -978,6 +1002,13 @@ * A rule in a menu */ MENU.ITEM.RULE = MENU.ITEM.Subclass({ + role: "separator", + + Attributes: function(def) { + def = HUB.Insert({"aria-orientation": "vertical"}, def); + def = this.SUPER(arguments).Attributes.call(this, def); + return def; + }, Label: function (def,menu) { def.className += " MathJax_MenuRule"; return null; From e3a62c0dfe165ed2b564be7c5646ded141af75d3 Mon Sep 17 00:00:00 2001 From: zorkow Date: Mon, 14 Sep 2015 01:43:57 +0100 Subject: [PATCH 16/19] Fixes the menu role. --- unpacked/extensions/MathMenu.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 8bcbd0163..1bb2834af 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -280,7 +280,7 @@ onmouseup: MENU.Mouseup, ondblclick: FALSE, ondragstart: FALSE, onselectstart: FALSE, oncontextmenu: FALSE, menuItem: this, className: "MathJax_Menu", onkeydown: MENU.Keydown, - role: "navigation" + role: "menu" }); if (!forceLTR) {MathJax.Localization.setCSS(menu)} @@ -897,9 +897,8 @@ role: "menuitemradio", Attributes: function(def) { - if (CONFIG.settings[this.variable] === this.value) { - def = HUB.Insert({"aria-checked": "true"}, def); - } + var checked = CONFIG.settings[this.variable] === this.value ? "true" : "false"; + def = HUB.Insert({"aria-checked": checked}, def); def = this.SUPER(arguments).Attributes.call(this, def); return def; }, @@ -947,9 +946,8 @@ role: "menuitemcheckbox", Attributes: function(def) { - if (CONFIG.settings[this.variable]) { - def = HUB.Insert({"aria-checked": "true"}, def); - } + var checked = CONFIG.settings[this.variable] ? "true" : "false"; + def = HUB.Insert({"aria-checked": checked}, def); def = this.SUPER(arguments).Attributes.call(this, def); return def; }, From 3b099e971aa80336009e73e08920df9798614f6e Mon Sep 17 00:00:00 2001 From: zorkow Date: Mon, 14 Sep 2015 02:03:21 +0100 Subject: [PATCH 17/19] Fixes labelling for close buttons. --- unpacked/extensions/HelpDialog.js | 4 ++-- unpacked/extensions/MathMenu.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unpacked/extensions/HelpDialog.js b/unpacked/extensions/HelpDialog.js index 2c16eb1ca..659408789 100644 --- a/unpacked/extensions/HelpDialog.js +++ b/unpacked/extensions/HelpDialog.js @@ -155,8 +155,8 @@ ]], ["a",{href:"http://www.mathjax.org/"},["www.mathjax.org"]], ["span",{id: "MathJax_HelpClose", onclick: HELP.Remove, - onkeydown: HELP.Keydown, tabIndex: 0, - "aria-label": "Close", "aria-describedby": "Close window"}, + onkeydown: HELP.Keydown, tabIndex: 0, role: "button", + "aria-label": "Close window"}, [["span",{},["\u00D7"]]] ] ])); diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index 1bb2834af..a76a0122b 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -1048,8 +1048,8 @@ ["a",{href:"http://www.mathjax.org/"},["www.mathjax.org"]], ["span",{className:"MathJax_MenuClose",id:"MathJax_AboutClose", onclick:MENU.About.Remove, - onkeydown: MENU.About.Keydown, tabIndex: 0, - "aria-label": "Close", "aria-describedby": "Close window"}, + onkeydown: MENU.About.Keydown, tabIndex: 0, role: "button", + "aria-label": "Close window"}, [["span",{},"\u00D7"]]] ]); about.focus(); From 7c870b6d93c64b79287cc49337e9d2ae6ce0f20a Mon Sep 17 00:00:00 2001 From: zorkow Date: Mon, 14 Sep 2015 11:55:50 +0100 Subject: [PATCH 18/19] Cleaned code. --- unpacked/extensions/MathMenu.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js index a76a0122b..ab1e698bd 100644 --- a/unpacked/extensions/MathMenu.js +++ b/unpacked/extensions/MathMenu.js @@ -604,7 +604,6 @@ }, Create: function (menu) { - console.log('create'); if (!this.hidden) { var def = this.Attributes(); var label = this.Label(def,menu); @@ -915,7 +914,6 @@ return [["span",span,[this.marker]]," "+this.Name()]; }, Mouseup: function (event,menu) { - console.log(menu); if (!this.disabled) { var child = menu.parentNode.childNodes; for (var i = 0, m = child.length; i < m; i++) { @@ -926,7 +924,6 @@ } menu.firstChild.display = ""; CONFIG.settings[this.variable] = this.value; - console.log('Changing'); MENU.cookie[this.variable] = CONFIG.settings[this.variable]; MENU.saveCookie(); SIGNAL.Post(["radio button",this]); } From 00af8c161ef8cad47c919691e499e30779c176a9 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 14 Sep 2015 06:57:01 -0400 Subject: [PATCH 19/19] Use isEdge for MSEdge detection --- unpacked/extensions/MathML/mml3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js index 27eac324e..90a98f59b 100644 --- a/unpacked/extensions/MathML/mml3.js +++ b/unpacked/extensions/MathML/mml3.js @@ -80,7 +80,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { */ var BROWSER = MathJax.Hub.Browser; var exslt = ''; - if (!!navigator.userAgent.match(/ Edge\//) || BROWSER.isMSIE) { + if (BROWSER.isEdge || BROWSER.isMSIE) { exslt = 'urn:schemas-microsoft-com:xslt' } else { exslt = 'http://exslt.org/common';