jodit 4.12.28 → 4.12.30
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 +12 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +22 -11
- package/es2015/jodit.min.js +2 -2
- 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 +2 -2
- package/es2018/jodit.min.js +2 -2
- 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 +2 -2
- package/es2021/jodit.js +22 -11
- package/es2021/jodit.min.js +2 -2
- 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 +2 -2
- package/es2021.en/jodit.js +22 -11
- package/es2021.en/jodit.min.js +2 -2
- 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 +22 -11
- 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/core/event-emitter/event-emitter.js +6 -6
- package/esm/core/helpers/html/apply-styles.js +14 -3
- 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.12.
|
|
6
|
+
export const APP_VERSION = "4.12.30";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -53,12 +53,12 @@ export class EventEmitter {
|
|
|
53
53
|
}
|
|
54
54
|
__removeStoreFromSubject(subject) {
|
|
55
55
|
if (subject[this.__key] !== undefined) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
// Fully remove the namespaces store key instead of just setting it to
|
|
57
|
+
// `undefined`. On long-lived subjects — e.g. `window` in an SPA where
|
|
58
|
+
// editors are repeatedly created and destroyed — leftover `undefined`
|
|
59
|
+
// keys would otherwise pile up on the object. The property is defined
|
|
60
|
+
// as `configurable`, so `delete` removes it cleanly.
|
|
61
|
+
delete subject[this.__key];
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
__triggerNativeEvent(element, event) {
|
|
@@ -31,11 +31,22 @@ function normalizeCSS(s) {
|
|
|
31
31
|
* and then removes the selector styles, leaving only the inline ones.
|
|
32
32
|
*/
|
|
33
33
|
export function applyStyles(html) {
|
|
34
|
-
|
|
34
|
+
// Match the opening <html> tag whether or not it carries attributes. MS
|
|
35
|
+
// Word emits `<html xmlns:o=…>` (note the trailing space), but Excel/Calc
|
|
36
|
+
// wrap the copied table in a bare `<html>`. The old `'<html '` check missed
|
|
37
|
+
// the bare tag, so for Excel clipboards the `<style>` rules (class-based
|
|
38
|
+
// cell backgrounds/borders, e.g. `.xl31 { background:#FCE4D6 }`) were never
|
|
39
|
+
// inlined and all styling was lost once the `<style>` block got stripped.
|
|
40
|
+
// See https://github.com/xdan/jodit/issues/1362
|
|
41
|
+
const openMatch = /<html(?:\s[^>]*)?>/i.exec(html);
|
|
42
|
+
if (!openMatch) {
|
|
35
43
|
return html;
|
|
36
44
|
}
|
|
37
|
-
html = html.substring(
|
|
38
|
-
|
|
45
|
+
html = html.substring(openMatch.index);
|
|
46
|
+
const closeIndex = html.toLowerCase().lastIndexOf('</html>');
|
|
47
|
+
if (closeIndex !== -1) {
|
|
48
|
+
html = html.substring(0, closeIndex + '</html>'.length);
|
|
49
|
+
}
|
|
39
50
|
const iframe = globalDocument.createElement('iframe');
|
|
40
51
|
iframe.style.display = 'none';
|
|
41
52
|
globalDocument.body.appendChild(iframe);
|