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
This commit is contained in:
Derk-Jan Hartman 2012-03-25 22:35:13 +02:00
parent b9f87bb400
commit e592db16e7
2 changed files with 1 additions and 15 deletions

View File

@ -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");

View File

@ -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);