mathjax / MathJax-node

MathJax for Node
Apache License 2.0
614 stars 96 forks source link

sanitize user config broke ability to extend TeX.extensions #410

Closed simonista closed 6 years ago

simonista commented 6 years ago

https://github.com/mathjax/MathJax-node/issues/309 broke the ability to extend TeX.extensions, which we use to load the "color.js" extension.

Specifically, this configuration broke from 1.0.2 to 1.0.3:

mj.config({
  MathJax: {
    TeX: {
      extensions: ["color.js"]
    }
  }
});
simonista commented 6 years ago

I realize that we inadvertently overwrote the other TeX extensions loaded by default, so I understand the spirit of #309, but it would be good to still provide a mechanism to extend the defatuls

pkra commented 6 years ago

It sounds like you're looking for the extensions key in the config's options, https://github.com/mathjax/MathJax-node#configoptions. It expects a comma separated string of paths, e.g.,

mj.config({
    extensions: "TeX/color"
});

See also https://github.com/mathjax/MathJax-node/issues/401 for a related minor bug that will be fixed in the next release (but has a workaround).

simonista commented 6 years ago

Ah, thanks!