Skip to content

Commit

Permalink
fix: Update TinyMCE 7 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
carla-at-wiris committed Feb 21, 2025
1 parent e655348 commit f80572d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion demos/html/tinymce7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@wiris/mathtype-html-integration-devkit": "*",
"@wiris/mathtype-tinymce7": "*",
"tinymce": "^7.0.0"
"tinymce": "^7.7.0"
},
"devDependencies": {
"copy-webpack-plugin": "^12.0.2",
Expand Down
8 changes: 3 additions & 5 deletions demos/html/tinymce7/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ document.getElementById("version_editor").innerHTML = "TinyMCE: ";
tinymce.init({
selector: "#editor",
license_key: "gpl",
external_plugins: {
tiny_mce_wiris: `${window.location.href}dist/plugin.min.js`,
},
external_plugins: { tiny_mce_wiris: `${window.location.href}dist/plugin.min.js` },

// This option allows us to introduce mathml formulas
extended_valid_elements: "*[.*]",
valid_elements: "*[*]",
// This option disables the DOMPurify library, which is used to sanitize the content.
// This option prevents the DOMPurify library from filtering wiris MathML tags.
// It's necessary when you want to initialize the editor with a content that contains handwritten formulas.
xss_sanitization: false,
allow_mathml_annotation_encodings: ["wiris", "application/json"],
// 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
9 changes: 4 additions & 5 deletions packages/tinymce7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ Easily include quality math equations in your documents and digital content.
2. Add the plugin as an external plugin:

```js
tinymce.init({
external_plugins: {
tiny_mce_wiris: `node_modules/@wiris/mathtype-tinymce7/plugin.min.js`,
},
});
tinymce.init({ external_plugins: { tiny_mce_wiris: `node_modules/@wiris/mathtype-tinymce7/plugin.min.js` } });
```

3. Add MathType buttons to the TinyMCE7 toolbar and the recommended settings:
Expand All @@ -47,6 +43,9 @@ Easily include quality math equations in your documents and digital content.
// Not enabling this, will provide formulas from being created and rendered.
extended_valid_elements: "*[.*]",
valid_elements: "*[*]",
// This option prevents the DOMPurify library from filtering wiris MathML tags.
// It's necessary when you want to initialize the editor with a content that contains handwritten formulas.
allow_mathml_annotation_encodings: ["wiris", "application/json"],

// You could set a different language for MathType editor:
// language: 'fr_FR',
Expand Down

0 comments on commit f80572d

Please sign in to comment.