Merge "Adding the tex colors to our texvc configuration, Fixes the lacking colors as pointed out in bug 35186."

This commit is contained in:
Brion VIBBER 2012-03-26 21:05:50 +00:00 committed by Gerrit Code Review
commit 58e2a0796c
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);