From e592db16e7fd429cb9c60722960e105cc8c0f84a Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Sun, 25 Mar 2012 22:35:13 +0200 Subject: [PATCH] Adding the tex colors to our texvc configuration, Fixes the lacking colors as pointed out in bug 35186. We can remove the pre mathjax 2.0 color hack now that the color extensions is enabled. Change-Id: I7863e3131689b2140e31cd09a3d663113f686b83 --- modules/MathJax/config/TeX-AMS-texvc_HTML.js | 2 +- modules/MathJax/extensions/wiki2jax.js | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/MathJax/config/TeX-AMS-texvc_HTML.js b/modules/MathJax/config/TeX-AMS-texvc_HTML.js index 0ec6d61..25de719 100644 --- a/modules/MathJax/config/TeX-AMS-texvc_HTML.js +++ b/modules/MathJax/config/TeX-AMS-texvc_HTML.js @@ -1,6 +1,6 @@ MathJax.Hub.Config({ extensions: ["wiki2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js"], jax: ["input/TeX","output/HTML-CSS"], - TeX: {extensions: ["noErrors.js","noUndefined.js","AMSmath.js","AMSsymbols.js","texvc.js"]} + TeX: {extensions: ["noErrors.js","noUndefined.js","AMSmath.js","AMSsymbols.js","texvc.js", "color.js"]} }); MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-texvc_HTML.js"); diff --git a/modules/MathJax/extensions/wiki2jax.js b/modules/MathJax/extensions/wiki2jax.js index 9691b10..3cac9c6 100644 --- a/modules/MathJax/extensions/wiki2jax.js +++ b/modules/MathJax/extensions/wiki2jax.js @@ -45,20 +45,6 @@ MathJax.Extension.wiki2jax = { if (parent.firstChild === node) tex = "\\displaystyle{"+tex+"}"; } - // @fixme auto-enable the 'color' extension and drop this - var i; - while ((i = tex.search(/\\color{/)) != -1) { - var braces = 0; - for (i += 6; i < tex.length; i++) { - if (tex[i] == '{') braces++; - else if (tex[i] == '}') { - if (braces-- == 0) - break; - } - } - tex = (tex.substring(0, i) + "}" + tex.substring(i, tex.length)).replace(/\\color{(\w*)}/, "\\textcolor{$1}{"); - } - var script = document.createElement("script"); script.type = "math/tex" + mode; MathJax.HTML.setScript(script, tex);