From 62232315bec4e4ca2a91551e3aea3c5230feded2 Mon Sep 17 00:00:00 2001 From: Xavier Ripoll Date: Thu, 19 Oct 2023 14:50:37 +0200 Subject: [PATCH] move extended_valid_elements to demo app.js --- demos/html/tinymce6/src/app.js | 46 +++++++++++++++++++++++- packages/tinymce6/editor_plugin.src.js | 48 -------------------------- 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/demos/html/tinymce6/src/app.js b/demos/html/tinymce6/src/app.js index f5e3c679b..a2d8e8574 100644 --- a/demos/html/tinymce6/src/app.js +++ b/demos/html/tinymce6/src/app.js @@ -20,7 +20,51 @@ tinymce.init({ }, // This option allows us to introduce mathml formulas - extended_valid_elements: '*[.*]', + extended_valid_elements: [ + 'math[*]', + 'maction[*]', + 'malignmark[*]', + 'maligngroup[*]', + 'menclose[*]', + 'merror[*]', + 'mfenced[*]', + 'mfrac[*]', + 'mglyph[*]', + 'mi[*]', + 'mlabeledtr[*]', + 'mlongdiv[*]', + 'mmultiscripts[*]', + 'mn[*]', + 'mo[*]', + 'mover[*]', + 'mpadded[*]', + 'mphantom[*]', + 'mprescripts[*]', + 'none[*]', + 'mroot[*]', + 'mrow[*]', + 'ms[*]', + 'mscarries[*]', + 'mscarry[*]', + 'msgroup[*]', + 'msline[*]', + 'mspace[*]', + 'msqrt[*]', + 'msrow[*]', + 'mstack[*]', + 'mstyle[*]', + 'msub[*]', + 'msubsup[*]', + 'msup[*]', + 'mtable[*]', + 'mtd[*]', + 'mtext[*]', + 'mtr[*]', + 'munder[*]', + 'munderover[*]', + 'semantics[*]', + 'annotation[*]', + ].join(), // We recommend to set 'draggable_modal' to true to avoid overlapping issues // with the different UI modal dialog windows implementations between core and third-party plugins on TinyMCE. // @see: https://github.com/wiris/html-integrations/issues/134#issuecomment-905448642 diff --git a/packages/tinymce6/editor_plugin.src.js b/packages/tinymce6/editor_plugin.src.js index 87050a297..6617711ff 100644 --- a/packages/tinymce6/editor_plugin.src.js +++ b/packages/tinymce6/editor_plugin.src.js @@ -185,54 +185,6 @@ export const currentInstance = null; tinymce.PluginManager.add(pluginName, (editor, url) => ({ // eslint-disable-line no-unused-vars init(editor) { - // Array with MathML valid alements. - const validMathML = [ - 'math[*]', - 'maction[*]', - 'malignmark[*]', - 'maligngroup[*]', - 'menclose[*]', - 'merror[*]', - 'mfenced[*]', - 'mfrac[*]', - 'mglyph[*]', - 'mi[*]', - 'mlabeledtr[*]', - 'mlongdiv[*]', - 'mmultiscripts[*]', - 'mn[*]', - 'mo[*]', - 'mover[*]', - 'mpadded[*]', - 'mphantom[*]', - 'mprescripts[*]', - 'none[*]', - 'mroot[*]', - 'mrow[*]', - 'ms[*]', - 'mscarries[*]', - 'mscarry[*]', - 'msgroup[*]', - 'msline[*]', - 'mspace[*]', - 'msqrt[*]', - 'msrow[*]', - 'mstack[*]', - 'mstyle[*]', - 'msub[*]', - 'msubsup[*]', - 'msup[*]', - 'mtable[*]', - 'mtd[*]', - 'mtext[*]', - 'mtr[*]', - 'munder[*]', - 'munderover[*]', - 'semantics[*]', - 'annotation[*]', - ]; - - editor.options.set('extended_valid_elements', validMathML.join()); // editor.schema.addCustomElements(validMathML.join()); // editor.settings.extended_valid_elements += ; // eslint-disable-line no-param-reassign