Skip to content

Commit

Permalink
move extended_valid_elements to demo app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xripoll-at-wiris committed Oct 19, 2023
1 parent ab00bed commit 6223231
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 49 deletions.
46 changes: 45 additions & 1 deletion demos/html/tinymce6/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 0 additions & 48 deletions packages/tinymce6/editor_plugin.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6223231

Please sign in to comment.