jodit 4.12.39 → 4.12.43
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 +13 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +64 -7
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +4 -4
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +4 -4
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +4 -4
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +13 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +4 -4
- package/es2021/jodit.js +64 -7
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +4 -4
- 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 +13 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +4 -4
- package/es2021.en/jodit.js +64 -7
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +5 -5
- 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 +18 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +64 -8
- package/es5/jodit.min.css +3 -3
- 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/modules/widget/file-selector/file-selector.js +7 -1
- package/esm/modules/widget/tabs/tabs.js +0 -3
- package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
- package/esm/plugins/clean-html/helpers/index.js +1 -0
- package/esm/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
- package/esm/plugins/clean-html/helpers/is-allowed-media-embed.js +28 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +7 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/try-remove-node.js +9 -1
- package/package.json +1 -1
- package/types/plugins/clean-html/helpers/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
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.43";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -107,7 +107,13 @@ export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true
|
|
|
107
107
|
content: form.container
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
const box = TabsWidget(editor, tabs);
|
|
111
|
+
// Marks this popup so its tabs auto-size to their labels (see
|
|
112
|
+
// `.jodit-file-selector` in tabs.less) — long localized tab captions are no
|
|
113
|
+
// longer clipped — while leaving other tab popups (link, video …)
|
|
114
|
+
// untouched.
|
|
115
|
+
box.classList.add('jodit-file-selector');
|
|
116
|
+
return box;
|
|
111
117
|
};
|
|
112
118
|
function val(elm, selector, value) {
|
|
113
119
|
const child = elm.querySelector(selector);
|
|
@@ -99,9 +99,6 @@ export const TabsWidget = (jodit, tabs, state) => {
|
|
|
99
99
|
tab
|
|
100
100
|
};
|
|
101
101
|
});
|
|
102
|
-
Object.values(nameToTab).forEach(({ button }) => {
|
|
103
|
-
button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
|
|
104
|
-
});
|
|
105
102
|
const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
|
|
106
103
|
? firstTab
|
|
107
104
|
: state.activeTab;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module plugins/clean-html
|
|
8
8
|
*/
|
|
9
9
|
export * from "./get-hash";
|
|
10
|
+
export * from "./is-allowed-media-embed";
|
|
10
11
|
export * from "./remove-format/remove-format-for-collapsed-selection";
|
|
11
12
|
export * from "./remove-format/remove-format-for-selection";
|
|
12
13
|
export * from "./visitor/visit-node-walker";
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module plugins/clean-html
|
|
8
8
|
*/
|
|
9
9
|
export * from "./get-hash.js";
|
|
10
|
+
export * from "./is-allowed-media-embed.js";
|
|
10
11
|
export * from "./remove-format/remove-format-for-collapsed-selection.js";
|
|
11
12
|
export * from "./remove-format/remove-format-for-selection.js";
|
|
12
13
|
export * from "./visitor/visit-node-walker.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
|
|
8
|
+
* player. Such iframes are inserted intentionally through the Video button, so
|
|
9
|
+
* clean-html must not strip them (`denyTags` includes `iframe` by default) or
|
|
10
|
+
* neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
|
|
11
|
+
* are still removed.
|
|
12
|
+
*
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAllowedMediaEmbed(src: string): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/clean-html
|
|
8
|
+
*/
|
|
9
|
+
// The embed URLs produced by the built-in Video button (see
|
|
10
|
+
// `convertMediaUrlToVideoEmbed`): `//www.youtube.com/embed/<id>` and
|
|
11
|
+
// `//player.vimeo.com/video/<id>`. `youtube-nocookie.com` is the privacy
|
|
12
|
+
// variant YouTube offers for the same `/embed/` player. The `/embed/` and
|
|
13
|
+
// `/video/` path prefixes are required so a bare provider link
|
|
14
|
+
// (`youtube.com/@somebody`) is not treated as a player.
|
|
15
|
+
const YOUTUBE_EMBED = /^(https?:)?\/\/(www\.|m\.|music\.)?youtube(-nocookie)?\.com\/embed\//i;
|
|
16
|
+
const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
|
|
17
|
+
/**
|
|
18
|
+
* Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
|
|
19
|
+
* player. Such iframes are inserted intentionally through the Video button, so
|
|
20
|
+
* clean-html must not strip them (`denyTags` includes `iframe` by default) or
|
|
21
|
+
* neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
|
|
22
|
+
* are still removed.
|
|
23
|
+
*
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
export function isAllowedMediaEmbed(src) {
|
|
27
|
+
return YOUTUBE_EMBED.test(src) || VIMEO_EMBED.test(src);
|
|
28
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Dom } from "../../../../../core/dom/dom.js";
|
|
7
7
|
import { attr } from "../../../../../core/helpers/utils/attr.js";
|
|
8
|
+
import { isAllowedMediaEmbed } from "../../is-allowed-media-embed.js";
|
|
8
9
|
/**
|
|
9
10
|
* Add `sandbox=""` attribute to all `<iframe>` elements in the editor content
|
|
10
11
|
* @private
|
|
@@ -16,6 +17,12 @@ export function sandboxIframesInContent(jodit, nodeElm, hadEffect) {
|
|
|
16
17
|
return hadEffect;
|
|
17
18
|
}
|
|
18
19
|
const elm = nodeElm;
|
|
20
|
+
// A trusted YouTube/Vimeo player (inserted via the Video button) must not
|
|
21
|
+
// get an empty `sandbox=""` — that blocks scripts and stops playback. It
|
|
22
|
+
// is served in its own third-party origin, so leave it as-is (#1381).
|
|
23
|
+
if (isAllowedMediaEmbed(attr(elm, 'src') || '')) {
|
|
24
|
+
return hadEffect;
|
|
25
|
+
}
|
|
19
26
|
if (!elm.hasAttribute('sandbox')) {
|
|
20
27
|
attr(elm, 'sandbox', '');
|
|
21
28
|
return true;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { IS_INLINE } from "../../../../../core/constants.js";
|
|
7
7
|
import { Dom } from "../../../../../core/dom/dom.js";
|
|
8
8
|
import { trimInv } from "../../../../../core/helpers/string/trim.js";
|
|
9
|
+
import { attr } from "../../../../../core/helpers/utils/attr.js";
|
|
10
|
+
import { isAllowedMediaEmbed } from "../../is-allowed-media-embed.js";
|
|
9
11
|
/**
|
|
10
12
|
* @private
|
|
11
13
|
*/
|
|
@@ -24,7 +26,13 @@ function isRemovableNode(jodit, node, current, allow, deny) {
|
|
|
24
26
|
if (allow && !allow[node.nodeName]) {
|
|
25
27
|
return true;
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
// A YouTube/Vimeo player inserted through the Video button is trusted
|
|
30
|
+
// editor content, so keep it even though `iframe` is denied by default
|
|
31
|
+
// — otherwise the embed is stripped ~300ms after insertion (#1381).
|
|
32
|
+
// Arbitrary/bare iframes stay denied.
|
|
33
|
+
const isTrustedEmbed = node.nodeName === 'IFRAME' &&
|
|
34
|
+
isAllowedMediaEmbed(attr(node, 'src') || '');
|
|
35
|
+
if (!allow && deny && deny[node.nodeName] && !isTrustedEmbed) {
|
|
28
36
|
return true;
|
|
29
37
|
}
|
|
30
38
|
}
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module plugins/clean-html
|
|
8
8
|
*/
|
|
9
9
|
export * from "./get-hash";
|
|
10
|
+
export * from "./is-allowed-media-embed";
|
|
10
11
|
export * from "./remove-format/remove-format-for-collapsed-selection";
|
|
11
12
|
export * from "./remove-format/remove-format-for-selection";
|
|
12
13
|
export * from "./visitor/visit-node-walker";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
|
|
8
|
+
* player. Such iframes are inserted intentionally through the Video button, so
|
|
9
|
+
* clean-html must not strip them (`denyTags` includes `iframe` by default) or
|
|
10
|
+
* neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
|
|
11
|
+
* are still removed.
|
|
12
|
+
*
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAllowedMediaEmbed(src: string): boolean;
|