@wiris/mathtype-tinymce7 8.13.1 → 8.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/editor_plugin.src.js +28 -0
- package/package.json +2 -2
- package/plugin.min.js +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@ Easily include quality math equations in your documents and digital content.
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
9
9
|
- [Install instructions](#install-instructions)
|
|
10
|
-
- [Known issues](#known-issues)
|
|
11
10
|
- [Services](#services)
|
|
12
11
|
- [Documentation](#documentation)
|
|
13
12
|
- [Displaying on Target Page](#displaying-on-target-page)
|
|
@@ -21,7 +20,7 @@ Easily include quality math equations in your documents and digital content.
|
|
|
21
20
|
npm install @wiris/mathtype-tinymce7
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
> MathType is fully compatible with TinyMCE 7 from version 7.
|
|
23
|
+
> MathType is fully compatible with TinyMCE 7 from version 7.8.0.
|
|
25
24
|
|
|
26
25
|
2. Add the plugin as an external plugin:
|
|
27
26
|
|
|
@@ -39,14 +38,6 @@ Easily include quality math equations in your documents and digital content.
|
|
|
39
38
|
// @see: https://github.com/wiris/html-integrations/issues/134#issuecomment-905448642
|
|
40
39
|
draggable_modal: true,
|
|
41
40
|
|
|
42
|
-
// This option allows you to introduce mathml formulas with wiris plugins.
|
|
43
|
-
// Not enabling this, will provide formulas from being created and rendered.
|
|
44
|
-
extended_valid_elements: "*[.*]",
|
|
45
|
-
valid_elements: "*[*]",
|
|
46
|
-
// This option prevents the DOMPurify library from filtering wiris MathML tags.
|
|
47
|
-
// It's necessary when you want to initialize the editor with a content that contains handwritten formulas.
|
|
48
|
-
allow_mathml_annotation_encodings: ["wiris", "application/json"],
|
|
49
|
-
|
|
50
41
|
// You could set a different language for MathType editor:
|
|
51
42
|
// language: 'fr_FR',
|
|
52
43
|
// mathTypeParameters: {
|
|
@@ -63,9 +54,20 @@ Easily include quality math equations in your documents and digital content.
|
|
|
63
54
|
└───@wiris/mathtype-tinymce7
|
|
64
55
|
```
|
|
65
56
|
|
|
57
|
+
> Note: For Vite users, head to the known issues section for a workaround on the external plugin addition.
|
|
58
|
+
|
|
66
59
|
## Known issues
|
|
67
60
|
|
|
68
|
-
-
|
|
61
|
+
- We have not been able to update the latests TinyMCE plugin version on our CDN, which forces users to get the `@wiris/mathtype-tinymce7` external plugin dependency from the node_modules. This can raise issues in applications using vite, for example. Here's a workaround:
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
import wirisPlugin from '@wiris/mathtype-tinymce7/plugin.min.js?url';
|
|
65
|
+
|
|
66
|
+
tinymce.init({ external_plugins: {
|
|
67
|
+
tiny_mce_wiris: wirisPlugin,
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
69
71
|
- The editor's caret is lost when inserting a new formula on Safari with ChemType [#486](https://github.com/wiris/html-integrations/issues/486)
|
|
70
72
|
|
|
71
73
|
## Services
|
package/editor_plugin.src.js
CHANGED
|
@@ -255,6 +255,34 @@ export const currentInstance = null;
|
|
|
255
255
|
integrationModelProperties.integrationParameters = editor.options.get("mathTypeParameters");
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
// This option allows us to introduce MathML formulas.
|
|
259
|
+
editor.options.register("extended_valid_elements", {
|
|
260
|
+
processor: "string",
|
|
261
|
+
default: "*[.*]",
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// This option allows all elements and attributes.
|
|
265
|
+
editor.options.register("valid_elements", {
|
|
266
|
+
processor: "string",
|
|
267
|
+
default: "*[*]",
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// Those options prevent the DOMPurify library from filtering Wiris MathML tags and attributes.
|
|
271
|
+
editor.options.register("allow_mathml_annotation_encodings", {
|
|
272
|
+
processor: "array",
|
|
273
|
+
default: ["application/json"],
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
editor.options.register("extended_mathml_elements", {
|
|
277
|
+
processor: "array",
|
|
278
|
+
default: ["semantics", "annotation", "mstack", "msline", "msrow", "none"],
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
editor.options.register("extended_mathml_attributes", {
|
|
282
|
+
processor: "array",
|
|
283
|
+
default: ["linebreak", "charalign", "stackalign"],
|
|
284
|
+
});
|
|
285
|
+
|
|
258
286
|
integrationModelProperties.scriptName = "plugin.min.js";
|
|
259
287
|
integrationModelProperties.environment = {};
|
|
260
288
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiris/mathtype-tinymce7",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.3",
|
|
4
4
|
"description": "MathType Web for TinyMCE7 editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chem",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepack": "yarn && npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@wiris/mathtype-html-integration-devkit": "1.17.
|
|
35
|
+
"@wiris/mathtype-html-integration-devkit": "1.17.10"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/core": "^7.24.4",
|