jodit 4.14.5 → 4.14.6
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/CHANGELOG.md +6 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +29 -9
- package/es2015/jodit.min.js +3 -3
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +3 -3
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +3 -3
- package/es2021/jodit.js +29 -9
- package/es2021/jodit.min.js +3 -3
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +3 -3
- package/es2021.en/jodit.js +29 -9
- package/es2021.en/jodit.min.js +3 -3
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +29 -9
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/plugins/iframe/iframe.js +28 -9
- package/package.json +1 -1
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.14.
|
|
6
|
+
export const APP_VERSION = "4.14.6";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -101,6 +101,26 @@ export function iframe(editor) {
|
|
|
101
101
|
}
|
|
102
102
|
return html;
|
|
103
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Replace the whole iframe document with the given HTML.
|
|
106
|
+
*
|
|
107
|
+
* The markup is parsed in an inert document first (no browsing
|
|
108
|
+
* context: scripts do not run, sub-resources are not fetched),
|
|
109
|
+
* sanitized there via `safeHTML`, and only then moved into the
|
|
110
|
+
* live document. `document.write` on the live document would
|
|
111
|
+
* execute inline scripts and event handlers while parsing,
|
|
112
|
+
* before the sanitizer had a chance to strip them, and the
|
|
113
|
+
* iframe is same-origin with the host page by default.
|
|
114
|
+
* A `<script>` the cleaner is configured to keep still never
|
|
115
|
+
* executes: nodes coming from an inert parser are flagged
|
|
116
|
+
* "already started", exactly like `innerHTML`.
|
|
117
|
+
* See GHSA-w3xv-x3fm-59ph.
|
|
118
|
+
*/
|
|
119
|
+
const replaceDocument = (html) => {
|
|
120
|
+
const inert = new DOMParser().parseFromString(html, 'text/html');
|
|
121
|
+
editor.e.fire('safeHTML', inert.documentElement);
|
|
122
|
+
doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
|
|
123
|
+
};
|
|
104
124
|
if (docMode) {
|
|
105
125
|
const tag = editor.element.tagName;
|
|
106
126
|
if (tag !== 'TEXTAREA' && tag !== 'INPUT') {
|
|
@@ -117,21 +137,20 @@ export function iframe(editor) {
|
|
|
117
137
|
const old = doc.documentElement.outerHTML;
|
|
118
138
|
if (clearMarkers(old) !==
|
|
119
139
|
clearMarkers(value)) {
|
|
120
|
-
|
|
121
|
-
doc.write(editor.o.iframeDoctype +
|
|
122
|
-
clearMarkers(value));
|
|
123
|
-
doc.close();
|
|
140
|
+
replaceDocument(clearMarkers(value));
|
|
124
141
|
editor.editor = doc.body;
|
|
125
|
-
editor.e.fire('safeHTML', editor.editor);
|
|
126
142
|
toggleEditable();
|
|
127
143
|
editor.e.fire('prepareWYSIWYGEditor');
|
|
128
144
|
editor.e.stopPropagation('beforeSetNativeEditorValue');
|
|
129
145
|
}
|
|
146
|
+
return true;
|
|
130
147
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
148
|
+
// A partial value goes through the regular
|
|
149
|
+
// path: `clean-html` sanitizes it and the
|
|
150
|
+
// editor assigns it to `doc.body` via
|
|
151
|
+
// `innerHTML`. Writing the raw value here
|
|
152
|
+
// would fire its event handlers first.
|
|
153
|
+
return false;
|
|
135
154
|
}, { top: true });
|
|
136
155
|
}
|
|
137
156
|
editor.editor = doc.body;
|