mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-14 11:15:13 +00:00
Merge "Adding the tex colors to our texvc configuration, Fixes the lacking colors as pointed out in bug 35186."
This commit is contained in:
commit
58e2a0796c
2
modules/MathJax/config/TeX-AMS-texvc_HTML.js
vendored
2
modules/MathJax/config/TeX-AMS-texvc_HTML.js
vendored
|
@ -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");
|
||||
|
|
14
modules/MathJax/extensions/wiki2jax.js
vendored
14
modules/MathJax/extensions/wiki2jax.js
vendored
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue