use standard polyfills (only tested with esm)

This commit is contained in:
jfh
2020-08-09 18:33:17 +02:00
parent ff98330ddf
commit 842f59b6c1
21 changed files with 57243 additions and 3282 deletions

View File

@@ -7,8 +7,6 @@
* @copyright 2013 Jo Segaert
*
*/
// Todo: Wait for Mathjax 3.0 to get ES Module/avoid global
import {importScript} from '../../external/dynamic-import-polyfill/importModule.js';
export default {
name: 'mathjax',
@@ -204,7 +202,8 @@ export default {
// We use `extIconsPath` here for now as it does not vary with
// the modular type as does `extPath`
try {
await importScript(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
await import(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure);
// When MathJax is loaded get the div where the math will be rendered.
MathJax.Hub.queue.Push(function () {
math = MathJax.Hub.getAllJax('#mathjax_creator')[0];