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
package/es2015/jodit.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
  */
@@ -1829,7 +1829,7 @@ __webpack_require__.r(__webpack_exports__);
1829
1829
  * ```
1830
1830
  * @packageDocumentation
1831
1831
  * @module constants
1832
- */ const APP_VERSION = "4.12.41";
1832
+ */ const APP_VERSION = "4.12.43";
1833
1833
  // prettier-ignore
1834
1834
  const ES = "es2015";
1835
1835
  const IS_ES_MODERN = true;
@@ -28035,6 +28035,43 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__.Icon.set('eraser', (_eraser_svg_
28035
28035
 
28036
28036
 
28037
28037
 
28038
+
28039
+ /***/ }),
28040
+
28041
+ /***/ 28665:
28042
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
28043
+
28044
+ "use strict";
28045
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28046
+ /* harmony export */ isAllowedMediaEmbed: function() { return /* binding */ isAllowedMediaEmbed; }
28047
+ /* harmony export */ });
28048
+ /*!
28049
+ * Jodit Editor (https://xdsoft.net/jodit/)
28050
+ * Released under MIT see LICENSE.txt in the project root for license information.
28051
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
28052
+ */ /**
28053
+ * @module plugins/clean-html
28054
+ */ // The embed URLs produced by the built-in Video button (see
28055
+ // `convertMediaUrlToVideoEmbed`): `//www.youtube.com/embed/<id>` and
28056
+ // `//player.vimeo.com/video/<id>`. `youtube-nocookie.com` is the privacy
28057
+ // variant YouTube offers for the same `/embed/` player. The `/embed/` and
28058
+ // `/video/` path prefixes are required so a bare provider link
28059
+ // (`youtube.com/@somebody`) is not treated as a player.
28060
+ const YOUTUBE_EMBED = /^(https?:)?\/\/(www\.|m\.|music\.)?youtube(-nocookie)?\.com\/embed\//i;
28061
+ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
28062
+ /**
28063
+ * Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
28064
+ * player. Such iframes are inserted intentionally through the Video button, so
28065
+ * clean-html must not strip them (`denyTags` includes `iframe` by default) or
28066
+ * neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
28067
+ * are still removed.
28068
+ *
28069
+ * @private
28070
+ */ function isAllowedMediaEmbed(src) {
28071
+ return YOUTUBE_EMBED.test(src) || VIMEO_EMBED.test(src);
28072
+ }
28073
+
28074
+
28038
28075
  /***/ }),
28039
28076
 
28040
28077
  /***/ 37431:
@@ -28523,6 +28560,7 @@ __webpack_require__.r(__webpack_exports__);
28523
28560
  /* harmony export */ });
28524
28561
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
28525
28562
  /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
28563
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28665);
28526
28564
  /*!
28527
28565
  * Jodit Editor (https://xdsoft.net/jodit/)
28528
28566
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28531,6 +28569,7 @@ __webpack_require__.r(__webpack_exports__);
28531
28569
  * @module plugins/clean-html
28532
28570
  */
28533
28571
 
28572
+
28534
28573
  /**
28535
28574
  * Add `sandbox=""` attribute to all `<iframe>` elements in the editor content
28536
28575
  * @private
@@ -28539,6 +28578,12 @@ __webpack_require__.r(__webpack_exports__);
28539
28578
  return hadEffect;
28540
28579
  }
28541
28580
  const elm = nodeElm;
28581
+ // A trusted YouTube/Vimeo player (inserted via the Video button) must not
28582
+ // get an empty `sandbox=""` — that blocks scripts and stops playback. It
28583
+ // is served in its own third-party origin, so leave it as-is (#1381).
28584
+ if ((0,_is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__.isAllowedMediaEmbed)((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'src') || '')) {
28585
+ return hadEffect;
28586
+ }
28542
28587
  if (!elm.hasAttribute('sandbox')) {
28543
28588
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'sandbox', '');
28544
28589
  return true;
@@ -28675,6 +28720,8 @@ function filterStyleProperties(style, allowed) {
28675
28720
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
28676
28721
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
28677
28722
  /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
28723
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
28724
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28665);
28678
28725
  /*!
28679
28726
  * Jodit Editor (https://xdsoft.net/jodit/)
28680
28727
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28684,6 +28731,8 @@ function filterStyleProperties(style, allowed) {
28684
28731
  */
28685
28732
 
28686
28733
 
28734
+
28735
+
28687
28736
  /**
28688
28737
  * @private
28689
28738
  */ function tryRemoveNode(jodit, nodeElm, hadEffect, allowTags, denyTags, currentSelectionNode) {
@@ -28700,7 +28749,12 @@ function filterStyleProperties(style, allowed) {
28700
28749
  if (allow && !allow[node.nodeName]) {
28701
28750
  return true;
28702
28751
  }
28703
- if (!allow && deny && deny[node.nodeName]) {
28752
+ // A YouTube/Vimeo player inserted through the Video button is trusted
28753
+ // editor content, so keep it even though `iframe` is denied by default
28754
+ // — otherwise the embed is stripped ~300ms after insertion (#1381).
28755
+ // Arbitrary/bare iframes stay denied.
28756
+ const isTrustedEmbed = node.nodeName === 'IFRAME' && (0,_is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_4__.isAllowedMediaEmbed)((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(node, 'src') || '');
28757
+ if (!allow && deny && deny[node.nodeName] && !isTrustedEmbed) {
28704
28758
  return true;
28705
28759
  }
28706
28760
  }