jodit 4.12.41 → 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.
Files changed (59) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +57 -3
  5. package/es2015/jodit.min.js +3 -3
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +3 -3
  13. package/es2018/jodit.min.js +3 -3
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +3 -3
  18. package/es2021/jodit.js +57 -3
  19. package/es2021/jodit.min.js +3 -3
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +3 -3
  28. package/es2021.en/jodit.js +57 -3
  29. package/es2021.en/jodit.min.js +4 -4
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +57 -3
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
  52. package/esm/plugins/clean-html/helpers/index.js +1 -0
  53. package/esm/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
  54. package/esm/plugins/clean-html/helpers/is-allowed-media-embed.js +28 -0
  55. package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +7 -0
  56. package/esm/plugins/clean-html/helpers/visitor/filters/try-remove-node.js +9 -1
  57. package/package.json +1 -1
  58. package/types/plugins/clean-html/helpers/index.d.ts +1 -0
  59. package/types/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.41
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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.41";
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;
@@ -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
- if (!allow && deny && deny[node.nodeName]) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.12.41",
3
+ "version": "4.12.43",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -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;