From 73070cc7497e874b1cd84da2311cb64fa2cd7307 Mon Sep 17 00:00:00 2001 From: Sean Hogan Date: Fri, 15 Oct 2010 15:59:29 +1100 Subject: [PATCH 1/3] issue #3: MathJax init fail in IE9 (IE7 mode) --- mathjax/unpacked/MathJax.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mathjax/unpacked/MathJax.js b/mathjax/unpacked/MathJax.js index 5b3f13958..bb84433f0 100644 --- a/mathjax/unpacked/MathJax.js +++ b/mathjax/unpacked/MathJax.js @@ -247,7 +247,10 @@ MathJax.version = "1.0.5"; // var EVAL = function (code) {return eval.call(window,code)} EVAL("var __TeSt_VaR__ = 1"); // check if it works in global context - if (window.__TeSt_VaR__) {delete window.__TeSt_VaR__} else { + if (window.__TeSt_VaR__) { + try { delete window.__TeSt_VaR__; } // NOTE IE9 throws when in IE7 mode + catch (error) { window.__TeSt_VaR__ = null; } + } else { if (window.execScript) { // IE EVAL = function (code) { From fac13ed3516e1d90cdd4b7f81e48492b57300b16 Mon Sep 17 00:00:00 2001 From: Sean Hogan Date: Fri, 15 Oct 2010 16:04:27 +1100 Subject: [PATCH 2/3] issue #4: MathJax init fail in IE9 (IE9 mode) --- mathjax/unpacked/MathJax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathjax/unpacked/MathJax.js b/mathjax/unpacked/MathJax.js index bb84433f0..a6b55654f 100644 --- a/mathjax/unpacked/MathJax.js +++ b/mathjax/unpacked/MathJax.js @@ -1812,7 +1812,7 @@ MathJax.Hub.Startup = { for (var i = scripts.length-1; i >= 0; i--) { if (scripts[i].src.match(namePattern)) { STARTUP.script = scripts[i].innerHTML; - if (RegExp.$2 !== "") { + if (RegExp.$2) { STARTUP.params = {}; var params = RegExp.$2.substr(1).split(/\&/); for (var j = 0, m = params.length; j < m; j++) { From df61c069a017b02cc873b234209f7d97433662ad Mon Sep 17 00:00:00 2001 From: Sean Hogan Date: Fri, 29 Oct 2010 11:13:39 +1100 Subject: [PATCH 3/3] IE <= 8 parses MathML incorrectly. MathJax implements an alternative code path to get around this problem. This code was executed for all versions of IE, but IE9 parses MathML correctly, so this fix implements feature detection of MathML parsing. --- mathjax/unpacked/extensions/mml2jax.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mathjax/unpacked/extensions/mml2jax.js b/mathjax/unpacked/extensions/mml2jax.js index 426ebc2eb..f9fbe3e69 100644 --- a/mathjax/unpacked/extensions/mml2jax.js +++ b/mathjax/unpacked/extensions/mml2jax.js @@ -142,10 +142,10 @@ MathJax.Hub.Browser.Select({ MSIE: function (browser) { MathJax.Hub.Insert(MathJax.Extension.mml2jax,{ msieScriptBug: true, - msieMathTagBug: true - }) + msieMathTagBug: (MathJax.HTML.Element("span", {innerHTML:"x"}).childNodes.length !== 1) // IE < 9 corrupts MathML + }); } }); - + MathJax.Hub.Register.PreProcessor(["PreProcess",MathJax.Extension.mml2jax]); MathJax.Ajax.loadComplete("[MathJax]/extensions/mml2jax.js");