Skip to content

Commit cdea890

Browse files
committed
Make mhchem have a config parameter that can be used to select the new version (when it is available on the CDN) or the old legacy version.
1 parent 7523687 commit cdea890

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

unpacked/extensions/TeX/mhchem.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,19 @@
2626
*/
2727

2828
MathJax.Extension["TeX/mhchem"] = {
29-
version: "2.6.0"
29+
version: "2.6.0",
30+
config: MathJax.Hub.CombineConfig("TeX.mhchem",{
31+
legacy: true
32+
})
3033
};
3134

35+
if (!MathJax.Extension["TeX/mhchem"].config.legacy) {
36+
MathJax.Callback.Queue(
37+
["Require",MathJax.Ajax,"[Contrib]/mhchem/mhchem.js"],
38+
["loadComplete",MathJax.Ajax,"[MathJax]/extensions/TeX/mhchem.js"]
39+
);
40+
} else {
41+
3242
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
3343

3444
var TEX = MathJax.InputJax.TeX;
@@ -492,3 +502,4 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
492502
});
493503

494504
MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/mhchem.js");
505+
}

0 commit comments

Comments
 (0)