diff --git a/config/copy.config.js b/config/copy.config.js index eb780e38e..3bf310e37 100644 --- a/config/copy.config.js +++ b/config/copy.config.js @@ -14,24 +14,24 @@ module.exports = { dest: '{{WWW}}/' }, copyMathJaxMain: { - src: ['{{ROOT}}/node_modules/mathjax/*.js'], + src: ['{{ROOT}}/node_modules/mathjax/MathJax.js'], dest: '{{WWW}}/lib/mathjax' }, - copyMathJaxConfig: { - src: ['{{ROOT}}/node_modules/mathjax/config/**/*'], - dest: '{{WWW}}/lib/mathjax/config' - }, copyMathJaxExtensions: { src: ['{{ROOT}}/node_modules/mathjax/extensions/**/*'], dest: '{{WWW}}/lib/mathjax/extensions' }, - copyMathJaxFonts: { - src: ['{{ROOT}}/node_modules/mathjax/fonts/**/*'], - dest: '{{WWW}}/lib/mathjax/fonts' + copyMathJaxElement: { + src: ['{{ROOT}}/node_modules/mathjax/jax/element/**/*'], + dest: '{{WWW}}/lib/mathjax/jax/element' }, - copyMathJaxJax: { - src: ['{{ROOT}}/node_modules/mathjax/jax/**/*'], - dest: '{{WWW}}/lib/mathjax/jax' + copyMathJaxInput: { + src: ['{{ROOT}}/node_modules/mathjax/jax/input/**/*'], + dest: '{{WWW}}/lib/mathjax/jax/input' + }, + copyMathJaxOutput: { + src: ['{{ROOT}}/node_modules/mathjax/jax/output/SVG/**/*'], + dest: '{{WWW}}/lib/mathjax/jax/output/SVG' }, copyMathJaxLocalization: { src: ['{{ROOT}}/node_modules/mathjax/localization/**/*'], diff --git a/src/addon/filter/mathjaxloader/providers/handler.ts b/src/addon/filter/mathjaxloader/providers/handler.ts index 72f67ba66..51c9d8d0c 100644 --- a/src/addon/filter/mathjaxloader/providers/handler.ts +++ b/src/addon/filter/mathjaxloader/providers/handler.ts @@ -32,12 +32,35 @@ export class AddonFilterMathJaxLoaderHandler extends CoreFilterDefaultHandler { // Default values for MathJax config for sites where we cannot retrieve it. protected DEFAULT_URL = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js'; - protected DEFAULT_CONFIG = 'MathJax.Hub.Config({' + - 'config: ["Accessible.js", "Safe.js"],' + - 'errorSettings: { message: ["!"] },' + - 'skipStartupTypeset: true,' + - 'messageStyle: "none"' + - '});'; + protected DEFAULT_CONFIG = ` + MathJax.Hub.Config({ + extensions: [ + "Safe.js", + "tex2jax.js", + "mml2jax.js", + "MathEvents.js", + "MathZoom.js", + "MathMenu.js", + "toMathML.js", + "TeX/noErrors.js", + "TeX/noUndefined.js", + "TeX/AMSmath.js", + "TeX/AMSsymbols.js", + "fast-preview.js", + "AssistiveMML.js", + "[a11y]/accessibility-menu.js" + ], + jax: ["input/TeX","input/MathML","output/SVG"], + menuSettings: { + zoom: "Double-Click", + mpContext: true, + mpMouse: true + }, + errorSettings: { message: ["!"] }, + skipStartupTypeset: true, + messageStyle: "none" + }); + `; // List of language codes found in the MathJax/localization/ directory. protected MATHJAX_LANG_CODES = [