jodit 4.19.10 → 4.19.12

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 (98) hide show
  1. package/CHANGELOG.md +150 -131
  2. package/es2015/jodit.css +33 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +10 -10
  5. package/es2015/jodit.js +781 -195
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +10 -10
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +10 -10
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +10 -10
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +33 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +15 -15
  23. package/es2021/jodit.js +780 -193
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +15 -15
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +33 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +22 -22
  35. package/es2021.en/jodit.js +780 -193
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +22 -22
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +34 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +827 -200
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/dom/dom.js +2 -2
  61. package/esm/core/helpers/checker/is-html-from-word.d.ts +4 -3
  62. package/esm/core/helpers/checker/is-html-from-word.js +94 -14
  63. package/esm/core/helpers/checker/is-html.d.ts +4 -0
  64. package/esm/core/helpers/checker/is-html.js +54 -2
  65. package/esm/core/helpers/html/apply-styles.js +20 -11
  66. package/esm/core/helpers/html/clean-from-word.js +2 -3
  67. package/esm/core/helpers/html/index.d.ts +1 -0
  68. package/esm/core/helpers/html/index.js +1 -0
  69. package/esm/core/helpers/html/tag-scan.d.ts +36 -0
  70. package/esm/core/helpers/html/tag-scan.js +257 -0
  71. package/esm/core/helpers/string/trim.d.ts +4 -0
  72. package/esm/core/helpers/string/trim.js +29 -10
  73. package/esm/core/selection/helpers/index.js +3 -2
  74. package/esm/core/ui/button/tooltip/tooltip.d.ts +6 -0
  75. package/esm/core/ui/button/tooltip/tooltip.js +14 -3
  76. package/esm/core/view/view-with-toolbar.js +6 -1
  77. package/esm/jodit.js +2 -1
  78. package/esm/plugins/add-new-line/add-new-line.d.ts +5 -0
  79. package/esm/plugins/add-new-line/add-new-line.js +20 -3
  80. package/esm/plugins/delete/delete.d.ts +7 -0
  81. package/esm/plugins/delete/delete.js +38 -2
  82. package/esm/plugins/hr/hr.js +5 -0
  83. package/esm/plugins/iframe/iframe.js +59 -12
  84. package/esm/plugins/media/media.js +10 -9
  85. package/esm/plugins/paste/helpers.js +4 -2
  86. package/esm/plugins/resizer/resizer.js +6 -5
  87. package/esm/plugins/select-cells/select-cells.d.ts +1 -0
  88. package/esm/plugins/select-cells/select-cells.js +12 -18
  89. package/package.json +1 -1
  90. package/types/core/helpers/checker/is-html-from-word.d.ts +4 -3
  91. package/types/core/helpers/checker/is-html.d.ts +4 -0
  92. package/types/core/helpers/html/index.d.ts +1 -0
  93. package/types/core/helpers/html/tag-scan.d.ts +36 -0
  94. package/types/core/helpers/string/trim.d.ts +4 -0
  95. package/types/core/ui/button/tooltip/tooltip.d.ts +6 -0
  96. package/types/plugins/add-new-line/add-new-line.d.ts +5 -0
  97. package/types/plugins/delete/delete.d.ts +7 -0
  98. package/types/plugins/select-cells/select-cells.d.ts +1 -0
package/es2021/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.19.10
4
+ * Version: v4.19.12
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1824,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
1824
1824
  * ```
1825
1825
  * @packageDocumentation
1826
1826
  * @module constants
1827
- */ const APP_VERSION = "4.19.10";
1827
+ */ const APP_VERSION = "4.19.12";
1828
1828
  // prettier-ignore
1829
1829
  const ES = "es2021";
1830
1830
  const IS_ES_MODERN = true;
@@ -3086,14 +3086,15 @@ function wait(condition) {
3086
3086
  /* harmony import */ var jodit_core_helpers_checker_is_set__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3213);
3087
3087
  /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85932);
3088
3088
  /* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18303);
3089
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4040);
3090
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28712);
3091
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__);
3092
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7909);
3093
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80991);
3094
- /* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(36400);
3095
- /* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33201);
3096
- /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(71125);
3089
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81910);
3090
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4040);
3091
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28712);
3092
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__);
3093
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7909);
3094
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(80991);
3095
+ /* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(36400);
3096
+ /* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(33201);
3097
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(71125);
3097
3098
  /*!
3098
3099
  * Jodit Editor (https://xdsoft.net/jodit/)
3099
3100
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -3118,7 +3119,7 @@ function wait(condition) {
3118
3119
 
3119
3120
 
3120
3121
 
3121
- const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR}[^>]*>(.+?)</\\1>`, 'gi');
3122
+
3122
3123
  /**
3123
3124
  * Module for working with DOM
3124
3125
  */ class Dom {
@@ -3196,7 +3197,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3196
3197
  const wrapper = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(tag) ? create.element(tag) : tag;
3197
3198
  if (Dom.isNode(current)) {
3198
3199
  if (!current.parentNode) {
3199
- throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)('Element should be in DOM');
3200
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_14__.error)('Element should be in DOM');
3200
3201
  }
3201
3202
  current.parentNode.insertBefore(wrapper, current);
3202
3203
  wrapper.appendChild(current);
@@ -3246,12 +3247,12 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3246
3247
  }
3247
3248
  static replace(elm, newTagName, create, withAttributes = false, notMoveContent = false) {
3248
3249
  if ((0,jodit_core_helpers_checker_is_html__WEBPACK_IMPORTED_MODULE_4__.isHTML)(newTagName)) {
3249
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__.assert)(create, 'Need create instance for new tag');
3250
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(create, 'Need create instance for new tag');
3250
3251
  newTagName = create.fromHTML(newTagName);
3251
3252
  }
3252
3253
  let tag;
3253
3254
  if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(newTagName)) {
3254
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__.assert)(create, 'Need create instance for new tag');
3255
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(create, 'Need create instance for new tag');
3255
3256
  tag = create.element(newTagName);
3256
3257
  } else {
3257
3258
  tag = newTagName;
@@ -3300,7 +3301,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3300
3301
  } else {
3301
3302
  cond = condNoEmptyElement;
3302
3303
  }
3303
- const emptyText = (node)=>node.nodeValue == null || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_8__.trim)(node.nodeValue).length === 0;
3304
+ const emptyText = (node)=>node.nodeValue == null || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(node.nodeValue).length === 0;
3304
3305
  if (Dom.isText(node)) {
3305
3306
  return emptyText(node);
3306
3307
  }
@@ -3390,7 +3391,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3390
3391
  return Dom.isElement(node) && !/^(BR|HR)$/i.test(node.tagName) && [
3391
3392
  'inline',
3392
3393
  'inline-block'
3393
- ].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__.css)(node, 'display').toString()) !== -1;
3394
+ ].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_12__.css)(node, 'display').toString()) !== -1;
3394
3395
  }
3395
3396
  /**
3396
3397
  * It's block and it can be split
@@ -3564,13 +3565,13 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3564
3565
  * Returns the nearest non-empty sibling
3565
3566
  */ static findNotEmptySibling(node, left) {
3566
3567
  return Dom.findSibling(node, left, (n)=>{
3567
- return !Dom.isEmptyTextNode(n) && Boolean(!Dom.isText(n) || n.nodeValue?.length && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_8__.trim)(n.nodeValue));
3568
+ return !Dom.isEmptyTextNode(n) && Boolean(!Dom.isText(n) || n.nodeValue?.length && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(n.nodeValue));
3568
3569
  });
3569
3570
  }
3570
3571
  /**
3571
3572
  * Returns the nearest non-empty neighbor
3572
3573
  */ static findNotEmptyNeighbor(node, left, root) {
3573
- return (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_14__.call)(left ? Dom.prev : Dom.next, node, (n)=>Boolean(n && (!(Dom.isText(n) || Dom.isComment(n)) || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_8__.trim)(n?.nodeValue || '').length)), root);
3574
+ return (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_15__.call)(left ? Dom.prev : Dom.next, node, (n)=>Boolean(n && (!(Dom.isText(n) || Dom.isComment(n)) || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(n?.nodeValue || '').length)), root);
3574
3575
  }
3575
3576
  static sibling(node, left) {
3576
3577
  return left ? node.previousSibling : node.nextSibling;
@@ -3715,7 +3716,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3715
3716
  if (!node) {
3716
3717
  return;
3717
3718
  }
3718
- ;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_12__.dataBind)(node, '__old_display', node.style.getPropertyValue('display'));
3719
+ ;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__.dataBind)(node, '__old_display', node.style.getPropertyValue('display'));
3719
3720
  node.style.setProperty('display', 'none');
3720
3721
  }
3721
3722
  /**
@@ -3724,7 +3725,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3724
3725
  if (!node) {
3725
3726
  return;
3726
3727
  }
3727
- const display = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_12__.dataBind)(node, '__old_display');
3728
+ const display = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__.dataBind)(node, '__old_display');
3728
3729
  if (node.style.getPropertyValue('display') === 'none') {
3729
3730
  node.style.setProperty('display', display || null);
3730
3731
  }
@@ -3745,8 +3746,8 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3745
3746
  /**
3746
3747
  * Marks an item as temporary
3747
3748
  */ static markTemporary(element, attributes) {
3748
- attributes && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(element, attributes);
3749
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR, true);
3749
+ attributes && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, attributes);
3750
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR, true);
3750
3751
  return element;
3751
3752
  }
3752
3753
  /**
@@ -3755,7 +3756,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3755
3756
  if (!Dom.isElement(element)) {
3756
3757
  return false;
3757
3758
  }
3758
- return Dom.isMarker(element) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR) === 'true';
3759
+ return Dom.isMarker(element) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR) === 'true';
3759
3760
  }
3760
3761
  /**
3761
3762
  * Define element is selection helper
@@ -3765,7 +3766,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3765
3766
  /**
3766
3767
  * Unwrap temporary elements inside a HTML string (keeps their content)
3767
3768
  */ static replaceTemporaryFromString(value) {
3768
- return value.replace(TEMP_ELEMENT_REG_EXP, '$2');
3769
+ return (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_8__.unwrapMarkedTags)(value, null, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR);
3769
3770
  }
3770
3771
  /**
3771
3772
  * Collect the temporary elements (`data-jodit-temp`) inside the root.
@@ -5325,16 +5326,96 @@ function isFastEqual(a, b) {
5325
5326
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5326
5327
  */ /**
5327
5328
  * @module helpers/checker
5328
- */ /**
5329
+ */ const SPACE = /\s/;
5330
+ const DIGIT = /\d/;
5331
+ const WORD_CHAR = /\w/;
5332
+ // `content="Microsoft Word 15"` — the name followed by a space and a version digit
5333
+ function hasGenerator(tag, name) {
5334
+ let index = tag.indexOf(name);
5335
+ while(index !== -1){
5336
+ const after = index + name.length;
5337
+ if (SPACE.test(tag.charAt(after)) && DIGIT.test(tag.charAt(after + 1))) {
5338
+ return true;
5339
+ }
5340
+ index = tag.indexOf(name, after);
5341
+ }
5342
+ return false;
5343
+ }
5344
+ // `<meta name=ProgId content=Word.Document>`, `<meta name=Generator content="LibreOffice 7.6">`
5345
+ function isOfficeMeta(tag) {
5346
+ if (hasGenerator(tag, 'Microsoft Word') || hasGenerator(tag, 'Microsoft Excel')) {
5347
+ return true;
5348
+ }
5349
+ const lower = tag.toLowerCase();
5350
+ const progId = lower.indexOf('progid');
5351
+ if (progId !== -1 && (lower.indexOf('word.', progId) !== -1 || lower.indexOf('excel.', progId) !== -1)) {
5352
+ return true;
5353
+ }
5354
+ return lower.includes('libreoffice') || lower.includes('openoffice');
5355
+ }
5356
+ // ` class=MsoNormal`, ` class="MsoListParagraph"` inside one tag
5357
+ function hasMsoClass(tag) {
5358
+ let index = tag.indexOf('class=');
5359
+ while(index !== -1){
5360
+ if (index > 0 && SPACE.test(tag.charAt(index - 1))) {
5361
+ let value = index + 'class='.length;
5362
+ const quote = tag.charAt(value);
5363
+ if (quote === '"' || quote === "'") {
5364
+ value += 1;
5365
+ }
5366
+ if (tag.startsWith('Mso', value)) {
5367
+ return true;
5368
+ }
5369
+ }
5370
+ index = tag.indexOf('class=', index + 'class='.length);
5371
+ }
5372
+ return false;
5373
+ }
5374
+ // `style='mso-list:l0 level1 lfo1'` — an `mso-` property inside a style attribute with the given quote
5375
+ function hasMsoStyle(data, quote) {
5376
+ const open = 'style=' + quote;
5377
+ let index = data.indexOf(open);
5378
+ while(index !== -1){
5379
+ const start = index + open.length;
5380
+ let end = data.indexOf(quote, start);
5381
+ if (end === -1) {
5382
+ end = data.length;
5383
+ }
5384
+ if (data.slice(start, end).includes('mso-')) {
5385
+ return true;
5386
+ }
5387
+ index = data.indexOf(open, end);
5388
+ }
5389
+ return false;
5390
+ }
5391
+ /**
5329
5392
  * Detect if string is HTML from MS Word, Excel or LibreOffice/OpenOffice
5393
+ *
5394
+ * The clipboard text is attacker controlled, so every check walks the string
5395
+ * once with `indexOf`: a regex with an unbounded group before a required
5396
+ * literal was quadratic on a long run of `<meta` and froze the tab.
5330
5397
  */ function isHtmlFromWord(data) {
5331
- return data.search(/<meta.*?Microsoft Excel\s[\d].*?>/) !== -1 || data.search(/<meta.*?Microsoft Word\s[\d].*?>/) !== -1 || // `<meta name=ProgId content=Word.Document>` — attribute values are
5332
- // unquoted in the raw Word clipboard fragment
5333
- data.search(/<meta[^>]*?ProgId[^>]*?(Word|Excel)\./i) !== -1 || // LibreOffice/OpenOffice Writer & Calc
5334
- data.search(/<meta[^>]*?(LibreOffice|OpenOffice)/i) !== -1 || // Office namespaces on the root element of the clipboard fragment
5335
- data.search(/urn:schemas-microsoft-com:office:(word|excel)/) !== -1 || // `class=MsoNormal` and friends (unquoted/quoted)
5336
- data.search(/<\w[^>]*\sclass=("|')?Mso/) !== -1 || // the raw Word clipboard uses SINGLE quotes: style='mso-…'
5337
- data.search(/style='[^']*mso-/) !== -1 || data.search(/style="[^"]*mso-/) !== -1 && data.search(/<font/) !== -1;
5398
+ if (data.includes('urn:schemas-microsoft-com:office:word') || data.includes('urn:schemas-microsoft-com:office:excel')) {
5399
+ return true;
5400
+ }
5401
+ // Each tag is taken once, from its `<` to the next `>`, so the scan stays linear
5402
+ let index = data.indexOf('<');
5403
+ while(index !== -1){
5404
+ if (!WORD_CHAR.test(data.charAt(index + 1))) {
5405
+ index = data.indexOf('<', index + 1);
5406
+ continue;
5407
+ }
5408
+ let end = data.indexOf('>', index);
5409
+ if (end === -1) {
5410
+ end = data.length;
5411
+ }
5412
+ const tag = data.slice(index, end);
5413
+ if (tag.slice(0, 5).toLowerCase() === '<meta' && isOfficeMeta(tag) || hasMsoClass(tag)) {
5414
+ return true;
5415
+ }
5416
+ index = data.indexOf('<', end);
5417
+ }
5418
+ return hasMsoStyle(data, "'") || hasMsoStyle(data, '"') && data.includes('<font');
5338
5419
  }
5339
5420
 
5340
5421
 
@@ -5352,9 +5433,62 @@ function isFastEqual(a, b) {
5352
5433
  */ /**
5353
5434
  * @module helpers/checker
5354
5435
  */
5436
+ const NAME_START = /[A-Za-z]/;
5437
+ const NAME_CHAR = /[A-Za-z0-9]/;
5438
+ const WORD_CHAR = /\w/;
5439
+ // The tag name at `from`, or '' when there is none
5440
+ function readTagName(str, from) {
5441
+ if (!NAME_START.test(str.charAt(from))) {
5442
+ return '';
5443
+ }
5444
+ let end = from + 1;
5445
+ while(NAME_CHAR.test(str.charAt(end))){
5446
+ end += 1;
5447
+ }
5448
+ return str.slice(from, end);
5449
+ }
5450
+ // Is there an element `<name ...>` closed later by `</name>`? One pass for the closing tags, one for the opening ones
5451
+ function hasElement(str) {
5452
+ const lastClose = new Map();
5453
+ let index = str.indexOf('</');
5454
+ while(index !== -1){
5455
+ const name = readTagName(str, index + 2);
5456
+ if (name !== '' && str.charAt(index + 2 + name.length) === '>') {
5457
+ lastClose.set(name, index);
5458
+ }
5459
+ index = str.indexOf('</', index + 2);
5460
+ }
5461
+ if (lastClose.size === 0) {
5462
+ return false;
5463
+ }
5464
+ let gt = -1;
5465
+ index = str.indexOf('<');
5466
+ while(index !== -1){
5467
+ const name = readTagName(str, index + 1);
5468
+ const after = index + 1 + name.length;
5469
+ if (name !== '' && !WORD_CHAR.test(str.charAt(after))) {
5470
+ if (gt < after) {
5471
+ gt = str.indexOf('>', after);
5472
+ }
5473
+ if (gt === -1) {
5474
+ return false;
5475
+ }
5476
+ const close = lastClose.get(name);
5477
+ if (close !== undefined && close > gt) {
5478
+ return true;
5479
+ }
5480
+ }
5481
+ index = str.indexOf('<', index + 1);
5482
+ }
5483
+ return false;
5484
+ }
5355
5485
  /**
5356
5486
  * Check if a string is html or not
5357
- */ const isHTML = (str)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString)(str) && /<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(str.replace(/[\r\n]/g, ''));
5487
+ *
5488
+ * The pasted text is attacker controlled, so the check walks the string with
5489
+ * `indexOf`: the former regex `<(\w+)[^>]*>(.*?)<\/\1>` was quadratic on a
5490
+ * long run of `<a>` and froze the tab.
5491
+ */ const isHTML = (str)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString)(str) && hasElement(str);
5358
5492
 
5359
5493
  /* harmony export */ __webpack_require__.d(__webpack_exports__, [
5360
5494
  /* harmony export */ "isHTML", 0, /* binding */ isHTML
@@ -5873,11 +6007,12 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
5873
6007
  /* harmony export */ });
5874
6008
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
5875
6009
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
5876
- /* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75480);
5877
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4040);
5878
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
5879
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
5880
- /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28723);
6010
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81910);
6011
+ /* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
6012
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
6013
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
6014
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
6015
+ /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(28723);
5881
6016
  /*!
5882
6017
  * Jodit Editor (https://xdsoft.net/jodit/)
5883
6018
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -5891,8 +6026,19 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
5891
6026
 
5892
6027
 
5893
6028
 
6029
+
6030
+ // Drop the `mso-*` and `border*` declarations and turn pt/cm into px; one declaration at a time, so a long value cannot make the regexes backtrack
5894
6031
  function normalizeCSS(s) {
5895
- return s.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi, '').replace(/mso-[a-z-]+:[\s]*[^";']+$/gi, '').replace(/border[a-z-]*:[\s]*[^;]+;/gi, '').replace(/([0-9.]+)(pt|cm)/gi, (match, units, metrics)=>{
6032
+ const declarations = s.split(';');
6033
+ const last = declarations.length - 1;
6034
+ return declarations.filter((declaration, index)=>{
6035
+ const match = /^\s*([a-z-]{1,64})\s*:/i.exec(declaration);
6036
+ if (!match) {
6037
+ return true;
6038
+ }
6039
+ const property = match[1].toLowerCase();
6040
+ return !(property.startsWith('mso-') || property.startsWith('border') && index !== last);
6041
+ }).join(';').replace(/([0-9.]{1,32})(pt|cm)/gi, (match, units, metrics)=>{
5896
6042
  switch(metrics.toLowerCase()){
5897
6043
  case 'pt':
5898
6044
  return (parseFloat(units) * 1.328).toFixed(0) + 'px';
@@ -5914,17 +6060,17 @@ function normalizeCSS(s) {
5914
6060
  // cell backgrounds/borders, e.g. `.xl31 { background:#FCE4D6 }`) were never
5915
6061
  // inlined and all styling was lost once the `<style>` block got stripped.
5916
6062
  // See https://github.com/xdan/jodit/issues/1362
5917
- const openMatch = /<html(?:\s[^>]*)?>/i.exec(html);
5918
- if (!openMatch) {
6063
+ const open = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__.indexOfOpenTag)(html, 'html');
6064
+ if (open === -1) {
5919
6065
  return html;
5920
6066
  }
5921
- html = html.substring(openMatch.index);
6067
+ html = html.substring(open);
5922
6068
  const closeIndex = html.toLowerCase().lastIndexOf('</html>');
5923
6069
  if (closeIndex !== -1) {
5924
6070
  html = html.substring(0, closeIndex + '</html>'.length);
5925
6071
  }
5926
6072
  const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
5927
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(iframe, 'display', 'none');
6073
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(iframe, 'display', 'none');
5928
6074
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
5929
6075
  let convertedString = '', collection;
5930
6076
  try {
@@ -5933,14 +6079,14 @@ function normalizeCSS(s) {
5933
6079
  iframeDoc.open();
5934
6080
  iframeDoc.write(html);
5935
6081
  iframeDoc.close();
5936
- const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.readWordListItems)(iframeDoc.body);
6082
+ const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(iframeDoc.body);
5937
6083
  // Word marks its auto-generated list markers (the literal
5938
6084
  // bullet/number, e.g. `1.` or `·`) with `mso-list:Ignore`.
5939
6085
  // They are display-only and must not be imported, otherwise
5940
6086
  // the marker text leaks into the content. Drop them before any
5941
6087
  // style normalization strips the `mso-list` hint. See #948
5942
6088
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
5943
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style') || '')) {
6089
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style') || '')) {
5944
6090
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
5945
6091
  }
5946
6092
  });
@@ -5951,7 +6097,7 @@ function normalizeCSS(s) {
5951
6097
  if (rules[idx].selectorText === '') {
5952
6098
  continue;
5953
6099
  }
5954
- collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__.$$)(rules[idx].selectorText, iframeDoc.body);
6100
+ collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_7__.$$)(rules[idx].selectorText, iframeDoc.body);
5955
6101
  // `style.cssText` on purpose: the CSSOM parses the text,
5956
6102
  // drops invalid declarations and re-serializes it. The raw
5957
6103
  // `style` attribute would keep Word-only junk verbatim
@@ -5965,19 +6111,19 @@ function normalizeCSS(s) {
5965
6111
  throw e;
5966
6112
  }
5967
6113
  }
5968
- ;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.wrapWordListItems)(listItems);
6114
+ ;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
5969
6115
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
5970
6116
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node)) {
5971
- const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style');
6117
+ const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style');
5972
6118
  if (cssText) {
5973
6119
  node.style.cssText = normalizeCSS(cssText);
5974
6120
  }
5975
- if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style')) {
5976
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style', null);
6121
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style')) {
6122
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style', null);
5977
6123
  }
5978
6124
  }
5979
6125
  });
5980
- convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(iframeDoc.body.innerHTML) : '';
6126
+ convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim)(iframeDoc.body.innerHTML) : '';
5981
6127
  }
5982
6128
  } catch {} finally{
5983
6129
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(iframe);
@@ -5985,7 +6131,7 @@ function normalizeCSS(s) {
5985
6131
  if (convertedString) {
5986
6132
  html = convertedString;
5987
6133
  }
5988
- return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, ''));
6134
+ return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim)((0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__.removeWordWrappers)(html));
5989
6135
  }
5990
6136
 
5991
6137
 
@@ -6001,9 +6147,10 @@ function normalizeCSS(s) {
6001
6147
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
6002
6148
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
6003
6149
  /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
6004
- /* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
6005
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
6006
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
6150
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
6151
+ /* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75480);
6152
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4040);
6153
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7909);
6007
6154
  /*!
6008
6155
  * Jodit Editor (https://xdsoft.net/jodit/)
6009
6156
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -6016,6 +6163,7 @@ function normalizeCSS(s) {
6016
6163
 
6017
6164
 
6018
6165
 
6166
+
6019
6167
  /**
6020
6168
  * The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
6021
6169
  * content that matches the look and feel of the site.
@@ -6029,7 +6177,7 @@ function normalizeCSS(s) {
6029
6177
  const div = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('div');
6030
6178
  div.innerHTML = html;
6031
6179
  const marks = [];
6032
- const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(div);
6180
+ const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__.readWordListItems)(div);
6033
6181
  if (div.firstChild) {
6034
6182
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(div, (node)=>{
6035
6183
  if (!node) {
@@ -6054,7 +6202,7 @@ function normalizeCSS(s) {
6054
6202
  // with `mso-list:Ignore`. They are display-only
6055
6203
  // and must not be imported, otherwise the marker
6056
6204
  // text leaks into the content. See #948
6057
- if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style') || '')) {
6205
+ if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attr)(node, 'style') || '')) {
6058
6206
  marks.push(node);
6059
6207
  break;
6060
6208
  }
@@ -6068,7 +6216,7 @@ function normalizeCSS(s) {
6068
6216
  // `attrRaw`: SVG keeps camelCase names
6069
6217
  // (`viewBox`), `attr()` would kebab-case
6070
6218
  // them and silently skip the removal
6071
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attrRaw)(node, attribute.name, null);
6219
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attrRaw)(node, attribute.name, null);
6072
6220
  }
6073
6221
  });
6074
6222
  }
@@ -6081,14 +6229,14 @@ function normalizeCSS(s) {
6081
6229
  });
6082
6230
  }
6083
6231
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove.apply(null, marks);
6084
- (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
6232
+ (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__.wrapWordListItems)(listItems);
6085
6233
  convertedString = div.innerHTML;
6086
6234
  } catch (e) {}
6087
6235
  if (convertedString) {
6088
6236
  html = convertedString;
6089
6237
  }
6090
- html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim).join('\n');
6091
- return html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, '');
6238
+ html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_5__.trim).join('\n');
6239
+ return (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.removeWordWrappers)(html);
6092
6240
  }
6093
6241
 
6094
6242
 
@@ -6128,10 +6276,17 @@ function normalizeCSS(s) {
6128
6276
  /* harmony export */ applyStyles: function() { return /* reexport safe */ _apply_styles__WEBPACK_IMPORTED_MODULE_0__.applyStyles; },
6129
6277
  /* harmony export */ cleanFromWord: function() { return /* reexport safe */ _clean_from_word__WEBPACK_IMPORTED_MODULE_1__.cleanFromWord; },
6130
6278
  /* harmony export */ htmlspecialchars: function() { return /* reexport safe */ _htmlspecialchars__WEBPACK_IMPORTED_MODULE_2__.htmlspecialchars; },
6279
+ /* harmony export */ indexOfClosingTag: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.indexOfClosingTag; },
6280
+ /* harmony export */ indexOfOpenTag: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.indexOfOpenTag; },
6131
6281
  /* harmony export */ nl2br: function() { return /* reexport safe */ _nl2br__WEBPACK_IMPORTED_MODULE_3__.nl2br; },
6282
+ /* harmony export */ removeBetween: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeBetween; },
6283
+ /* harmony export */ removeEmptyMarkedTags: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags; },
6284
+ /* harmony export */ removeTagsByPrefix: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeTagsByPrefix; },
6285
+ /* harmony export */ removeWordWrappers: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeWordWrappers; },
6132
6286
  /* harmony export */ safeHTML: function() { return /* reexport safe */ _safe_html__WEBPACK_IMPORTED_MODULE_4__.safeHTML; },
6133
6287
  /* harmony export */ sanitizeHTMLElement: function() { return /* reexport safe */ _safe_html__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTMLElement; },
6134
- /* harmony export */ stripTags: function() { return /* reexport safe */ _strip_tags__WEBPACK_IMPORTED_MODULE_5__.stripTags; }
6288
+ /* harmony export */ stripTags: function() { return /* reexport safe */ _strip_tags__WEBPACK_IMPORTED_MODULE_5__.stripTags; },
6289
+ /* harmony export */ unwrapMarkedTags: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.unwrapMarkedTags; }
6135
6290
  /* harmony export */ });
6136
6291
  /* harmony import */ var _apply_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30893);
6137
6292
  /* harmony import */ var _clean_from_word__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1277);
@@ -6139,6 +6294,7 @@ function normalizeCSS(s) {
6139
6294
  /* harmony import */ var _nl2br__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48838);
6140
6295
  /* harmony import */ var _safe_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48155);
6141
6296
  /* harmony import */ var _strip_tags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(22852);
6297
+ /* harmony import */ var _tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
6142
6298
  /*!
6143
6299
  * Jodit Editor (https://xdsoft.net/jodit/)
6144
6300
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -6153,6 +6309,7 @@ function normalizeCSS(s) {
6153
6309
 
6154
6310
 
6155
6311
 
6312
+
6156
6313
  /***/ }),
6157
6314
 
6158
6315
  /***/ 48838:
@@ -6512,6 +6669,282 @@ function restoreTags(content) {
6512
6669
  }
6513
6670
 
6514
6671
 
6672
+ /***/ }),
6673
+
6674
+ /***/ 81910:
6675
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6676
+
6677
+ "use strict";
6678
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6679
+ /* harmony export */ indexOfClosingTag: function() { return /* binding */ indexOfClosingTag; },
6680
+ /* harmony export */ indexOfOpenTag: function() { return /* binding */ indexOfOpenTag; },
6681
+ /* harmony export */ removeBetween: function() { return /* binding */ removeBetween; },
6682
+ /* harmony export */ removeEmptyMarkedTags: function() { return /* binding */ removeEmptyMarkedTags; },
6683
+ /* harmony export */ removeTagsByPrefix: function() { return /* binding */ removeTagsByPrefix; },
6684
+ /* harmony export */ removeWordWrappers: function() { return /* binding */ removeWordWrappers; },
6685
+ /* harmony export */ unwrapMarkedTags: function() { return /* binding */ unwrapMarkedTags; }
6686
+ /* harmony export */ });
6687
+ /*!
6688
+ * Jodit Editor (https://xdsoft.net/jodit/)
6689
+ * Released under MIT see LICENSE.txt in the project root for license information.
6690
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6691
+ */ /**
6692
+ * @module helpers/html
6693
+ */ // Single passes over HTML that comes from the clipboard or the editor value.
6694
+ // A regex with `[^>]*` or `.*?` before a required literal backtracks
6695
+ // quadratically on a long run of tag openers, so these walk with `indexOf`.
6696
+ const TAG_NAME = /[a-z0-9:-]/i;
6697
+ // The tags the Word clean-up strips: `<html>`, `<colgroup>`, `<col>`, `<o:p>` and their closers
6698
+ const WORD_WRAPPER_TAGS = [
6699
+ '<html',
6700
+ '</html',
6701
+ '<col',
6702
+ '</col',
6703
+ '<o:p',
6704
+ '</o:p'
6705
+ ];
6706
+ function startsWithIgnoreCase(html, index, prefix) {
6707
+ return html.substr(index, prefix.length).toLowerCase() === prefix;
6708
+ }
6709
+ // The first `<` at or after `from` that opens one of the prefixes (`<meta`, `</html`, `<!--`)
6710
+ function indexOfPrefix(html, prefixes, from) {
6711
+ let index = html.indexOf('<', from);
6712
+ while(index !== -1){
6713
+ for (const prefix of prefixes){
6714
+ if (startsWithIgnoreCase(html, index, prefix)) {
6715
+ return [
6716
+ index,
6717
+ prefix
6718
+ ];
6719
+ }
6720
+ }
6721
+ index = html.indexOf('<', index + 1);
6722
+ }
6723
+ return [
6724
+ -1,
6725
+ ''
6726
+ ];
6727
+ }
6728
+ /**
6729
+ * The first `</name>` at or after `from`, case-insensitive, or -1
6730
+ */ function indexOfClosingTag(html, name, from) {
6731
+ const closing = '</' + name + '>';
6732
+ let index = html.indexOf('</', from);
6733
+ while(index !== -1){
6734
+ if (startsWithIgnoreCase(html, index, closing)) {
6735
+ return index;
6736
+ }
6737
+ index = html.indexOf('</', index + 2);
6738
+ }
6739
+ return -1;
6740
+ }
6741
+ /**
6742
+ * Remove every tag that starts with one of the prefixes, up to its `>`:
6743
+ * `removeTagsByPrefix(html, ['<meta', '<!--'])`
6744
+ */ function removeTagsByPrefix(html, prefixes) {
6745
+ const lower = prefixes.map((prefix)=>prefix.toLowerCase());
6746
+ let result = '';
6747
+ let cursor = 0;
6748
+ for(;;){
6749
+ const [start] = indexOfPrefix(html, lower, cursor);
6750
+ if (start === -1) {
6751
+ break;
6752
+ }
6753
+ const end = html.indexOf('>', start);
6754
+ if (end === -1) {
6755
+ break;
6756
+ }
6757
+ result += html.slice(cursor, start);
6758
+ cursor = end + 1;
6759
+ }
6760
+ return cursor === 0 ? html : result + html.slice(cursor);
6761
+ }
6762
+ /**
6763
+ * Strip the Word wrapper tags and then the comments, as the clean-up always did
6764
+ */ function removeWordWrappers(html) {
6765
+ return removeTagsByPrefix(removeTagsByPrefix(html, WORD_WRAPPER_TAGS), [
6766
+ '<!--'
6767
+ ]);
6768
+ }
6769
+ // Every `</name>` position by name, so the closer of an element is found by a binary search
6770
+ function closingTagPositions(html) {
6771
+ const positions = new Map();
6772
+ let index = html.indexOf('</');
6773
+ while(index !== -1){
6774
+ const name = readTagName(html, index + 2).toLowerCase();
6775
+ if (name !== '' && html.charAt(index + 2 + name.length) === '>') {
6776
+ const list = positions.get(name);
6777
+ if (list) {
6778
+ list.push(index);
6779
+ } else {
6780
+ positions.set(name, [
6781
+ index
6782
+ ]);
6783
+ }
6784
+ }
6785
+ index = html.indexOf('</', index + 2);
6786
+ }
6787
+ return positions;
6788
+ }
6789
+ // The first position in the sorted list that is >= from, or -1
6790
+ function firstAfter(list, from) {
6791
+ if (!list) {
6792
+ return -1;
6793
+ }
6794
+ let low = 0;
6795
+ let high = list.length;
6796
+ while(low < high){
6797
+ const middle = low + high >> 1;
6798
+ if (list[middle] < from) {
6799
+ low = middle + 1;
6800
+ } else {
6801
+ high = middle;
6802
+ }
6803
+ }
6804
+ return low < list.length ? list[low] : -1;
6805
+ }
6806
+ /**
6807
+ * The index of the first `<name>` or `<name …>` tag, or -1
6808
+ */ function indexOfOpenTag(html, name) {
6809
+ const prefix = '<' + name.toLowerCase();
6810
+ let cursor = 0;
6811
+ for(;;){
6812
+ const [start] = indexOfPrefix(html, [
6813
+ prefix
6814
+ ], cursor);
6815
+ if (start === -1) {
6816
+ return -1;
6817
+ }
6818
+ const next = html.charAt(start + prefix.length);
6819
+ if (next === '>') {
6820
+ return start;
6821
+ }
6822
+ if (/\s/.test(next)) {
6823
+ if (html.indexOf('>', start) === -1) {
6824
+ return -1;
6825
+ }
6826
+ return start;
6827
+ }
6828
+ cursor = start + 1;
6829
+ }
6830
+ }
6831
+ function readTagName(html, from) {
6832
+ let end = from;
6833
+ while(TAG_NAME.test(html.charAt(end))){
6834
+ end += 1;
6835
+ }
6836
+ return html.slice(from, end);
6837
+ }
6838
+ /**
6839
+ * Replace every `<name … marker …>inner</name>` with `inner`.
6840
+ * `name` null takes any tag; `keep` can refuse an element by its inner HTML.
6841
+ */ function unwrapMarkedTags(html, name, marker, keep) {
6842
+ const lowerMarker = marker.toLowerCase();
6843
+ const prefixes = [
6844
+ name == null ? '<' : '<' + name.toLowerCase()
6845
+ ];
6846
+ const closings = closingTagPositions(html);
6847
+ let result = '';
6848
+ let cursor = 0;
6849
+ for(;;){
6850
+ const [start] = indexOfPrefix(html, prefixes, cursor);
6851
+ if (start === -1) {
6852
+ break;
6853
+ }
6854
+ const tagName = (name ?? readTagName(html, start + 1)).toLowerCase();
6855
+ const gt = html.indexOf('>', start);
6856
+ if (gt === -1) {
6857
+ break;
6858
+ }
6859
+ const close = tagName !== '' && html.slice(start, gt).toLowerCase().includes(lowerMarker) ? firstAfter(closings.get(tagName), gt + 1) : -1;
6860
+ // Not a marked element: the `<` is text, the next one may still open an element
6861
+ if (close === -1) {
6862
+ result += html.slice(cursor, start + 1);
6863
+ cursor = start + 1;
6864
+ continue;
6865
+ }
6866
+ const inner = html.slice(gt + 1, close);
6867
+ const after = close + tagName.length + 3;
6868
+ result += html.slice(cursor, start);
6869
+ result += inner !== '' && (!keep || keep(inner)) ? inner : html.slice(start, after);
6870
+ cursor = after;
6871
+ }
6872
+ return cursor === 0 ? html : result + html.slice(cursor);
6873
+ }
6874
+ // The first `literal` at or after `from`, case-insensitive, or -1
6875
+ function indexOfLiteral(html, literal, from) {
6876
+ const head = literal.charAt(0);
6877
+ let index = html.indexOf(head, from);
6878
+ while(index !== -1){
6879
+ if (startsWithIgnoreCase(html, index, literal)) {
6880
+ return index;
6881
+ }
6882
+ index = html.indexOf(head, index + 1);
6883
+ }
6884
+ return -1;
6885
+ }
6886
+ /**
6887
+ * Remove every `open … openEnd … close` block whose opener holds `marker` (any opener when it is ''):
6888
+ * `removeBetween(html, '<style', '>', '</style>', 'jodit-box')`
6889
+ */ function removeBetween(html, open, openEnd, close, marker = '') {
6890
+ const lowerOpen = open.toLowerCase();
6891
+ const lowerMarker = marker.toLowerCase();
6892
+ let result = '';
6893
+ let cursor = 0;
6894
+ for(;;){
6895
+ const start = indexOfLiteral(html, lowerOpen, cursor);
6896
+ if (start === -1) {
6897
+ break;
6898
+ }
6899
+ const end = indexOfLiteral(html, openEnd, start + open.length);
6900
+ if (end === -1) {
6901
+ break;
6902
+ }
6903
+ if (lowerMarker !== '' && !html.slice(start, end).toLowerCase().includes(lowerMarker)) {
6904
+ result += html.slice(cursor, end + openEnd.length);
6905
+ cursor = end + openEnd.length;
6906
+ continue;
6907
+ }
6908
+ const closeIndex = indexOfLiteral(html, close, end + openEnd.length);
6909
+ if (closeIndex === -1) {
6910
+ break;
6911
+ }
6912
+ result += html.slice(cursor, start);
6913
+ cursor = closeIndex + close.length;
6914
+ }
6915
+ return cursor === 0 ? html : result + html.slice(cursor);
6916
+ }
6917
+ /**
6918
+ * Remove every empty `<name … marker …></name>` element
6919
+ */ function removeEmptyMarkedTags(html, name, marker) {
6920
+ const lowerName = name.toLowerCase();
6921
+ const lowerMarker = marker.toLowerCase();
6922
+ const closing = '</' + lowerName + '>';
6923
+ let result = '';
6924
+ let cursor = 0;
6925
+ for(;;){
6926
+ const [start] = indexOfPrefix(html, [
6927
+ '<' + lowerName
6928
+ ], cursor);
6929
+ if (start === -1) {
6930
+ break;
6931
+ }
6932
+ const gt = html.indexOf('>', start);
6933
+ if (gt === -1) {
6934
+ break;
6935
+ }
6936
+ if (html.slice(start, gt).toLowerCase().includes(lowerMarker) && startsWithIgnoreCase(html, gt + 1, closing)) {
6937
+ result += html.slice(cursor, start);
6938
+ cursor = gt + 1 + closing.length;
6939
+ continue;
6940
+ }
6941
+ result += html.slice(cursor, gt + 1);
6942
+ cursor = gt + 1;
6943
+ }
6944
+ return cursor === 0 ? html : result + html.slice(cursor);
6945
+ }
6946
+
6947
+
6515
6948
  /***/ }),
6516
6949
 
6517
6950
  /***/ 75480:
@@ -6711,6 +7144,8 @@ __webpack_require__.r(__webpack_exports__);
6711
7144
  /* harmony export */ hasContainer: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.hasContainer; },
6712
7145
  /* harmony export */ htmlspecialchars: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.htmlspecialchars; },
6713
7146
  /* harmony export */ i18n: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.i18n; },
7147
+ /* harmony export */ indexOfClosingTag: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag; },
7148
+ /* harmony export */ indexOfOpenTag: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag; },
6714
7149
  /* harmony export */ innerWidth: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.innerWidth; },
6715
7150
  /* harmony export */ isAbortError: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.isAbortError; },
6716
7151
  /* harmony export */ isArray: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.isArray; },
@@ -6752,6 +7187,10 @@ __webpack_require__.r(__webpack_exports__);
6752
7187
  /* harmony export */ normalizeUrl: function() { return /* reexport safe */ _normalize__WEBPACK_IMPORTED_MODULE_5__.normalizeUrl; },
6753
7188
  /* harmony export */ offset: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.offset; },
6754
7189
  /* harmony export */ position: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.position; },
7190
+ /* harmony export */ removeBetween: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeBetween; },
7191
+ /* harmony export */ removeEmptyMarkedTags: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeEmptyMarkedTags; },
7192
+ /* harmony export */ removeTagsByPrefix: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix; },
7193
+ /* harmony export */ removeWordWrappers: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeWordWrappers; },
6755
7194
  /* harmony export */ safeHTML: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.safeHTML; },
6756
7195
  /* harmony export */ sanitizeHTMLElement: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTMLElement; },
6757
7196
  /* harmony export */ setTimeout: function() { return /* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_1__.setTimeout; },
@@ -6764,7 +7203,9 @@ __webpack_require__.r(__webpack_exports__);
6764
7203
  /* harmony export */ trim: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trim; },
6765
7204
  /* harmony export */ trimChars: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimChars; },
6766
7205
  /* harmony export */ trimInv: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimInv; },
6767
- /* harmony export */ ucfirst: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.ucfirst; }
7206
+ /* harmony export */ trimInvEnd: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimInvEnd; },
7207
+ /* harmony export */ ucfirst: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.ucfirst; },
7208
+ /* harmony export */ unwrapMarkedTags: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.unwrapMarkedTags; }
6768
7209
  /* harmony export */ });
6769
7210
  /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45664);
6770
7211
  /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61077);
@@ -6776,7 +7217,7 @@ __webpack_require__.r(__webpack_exports__);
6776
7217
  /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97642);
6777
7218
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(93640);
6778
7219
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
6779
- /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _utils__WEBPACK_IMPORTED_MODULE_8__) if(["default","asArray","splitArray","toArray","clearTimeout","setTimeout","hasBrowserColorPicker","hasContainer","isAbortError","isArray","isBoolean","isDestructable","isEqual","isFastEqual","isFunction","isHTML","isHtmlFromWord","isInitable","isInt","isJoditObject","isLicense","isMarker","isNativeFunction","isNumber","isNumeric","isPlainObject","isPromise","isSet","isString","isStringArray","isURL","isValidName","isViewObject","isVoid","isWindow","colorToHex","applyStyles","cleanFromWord","htmlspecialchars","nl2br","safeHTML","sanitizeHTMLElement","stripTags","NUMBER_FIELDS_REG","normalizeColor","normalizeCssNumericValue","normalizeCssValue","normalizeKeyAliases","normalizeLicense","normalizePath","normalizeRelativePath","normalizeSize","normalizeUrl","getContentWidth","getFixedPositionOffset","getScrollParent","innerWidth","offset","position","size","CamelCaseToKebabCase","camelCase","fuzzySearchIndex","i18n","kebabCase","sprintf","stringify","trim","trimChars","trimInv","ucfirst"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _utils__WEBPACK_IMPORTED_MODULE_8__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
7220
+ /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _utils__WEBPACK_IMPORTED_MODULE_8__) if(["default","asArray","splitArray","toArray","clearTimeout","setTimeout","hasBrowserColorPicker","hasContainer","isAbortError","isArray","isBoolean","isDestructable","isEqual","isFastEqual","isFunction","isHTML","isHtmlFromWord","isInitable","isInt","isJoditObject","isLicense","isMarker","isNativeFunction","isNumber","isNumeric","isPlainObject","isPromise","isSet","isString","isStringArray","isURL","isValidName","isViewObject","isVoid","isWindow","colorToHex","applyStyles","cleanFromWord","htmlspecialchars","indexOfClosingTag","indexOfOpenTag","nl2br","removeBetween","removeEmptyMarkedTags","removeTagsByPrefix","removeWordWrappers","safeHTML","sanitizeHTMLElement","stripTags","unwrapMarkedTags","NUMBER_FIELDS_REG","normalizeColor","normalizeCssNumericValue","normalizeCssValue","normalizeKeyAliases","normalizeLicense","normalizePath","normalizeRelativePath","normalizeSize","normalizeUrl","getContentWidth","getFixedPositionOffset","getScrollParent","innerWidth","offset","position","size","CamelCaseToKebabCase","camelCase","fuzzySearchIndex","i18n","kebabCase","sprintf","stringify","trim","trimChars","trimInv","trimInvEnd","ucfirst"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _utils__WEBPACK_IMPORTED_MODULE_8__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
6780
7221
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
6781
7222
  /*!
6782
7223
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -7672,6 +8113,7 @@ function size(subject) {
7672
8113
  /* harmony export */ trim: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trim; },
7673
8114
  /* harmony export */ trimChars: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimChars; },
7674
8115
  /* harmony export */ trimInv: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimInv; },
8116
+ /* harmony export */ trimInvEnd: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimInvEnd; },
7675
8117
  /* harmony export */ ucfirst: function() { return /* reexport safe */ _ucfirst__WEBPACK_IMPORTED_MODULE_6__.ucfirst; }
7676
8118
  /* harmony export */ });
7677
8119
  /* harmony import */ var _camel_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57821);
@@ -7769,29 +8211,51 @@ const CamelCaseToKebabCase = (key)=>{
7769
8211
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7770
8212
  /* harmony export */ trim: function() { return /* binding */ trim; },
7771
8213
  /* harmony export */ trimChars: function() { return /* binding */ trimChars; },
7772
- /* harmony export */ trimInv: function() { return /* binding */ trimInv; }
8214
+ /* harmony export */ trimInv: function() { return /* binding */ trimInv; },
8215
+ /* harmony export */ trimInvEnd: function() { return /* binding */ trimInvEnd; }
7773
8216
  /* harmony export */ });
7774
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
7775
8217
  /*!
7776
8218
  * Jodit Editor (https://xdsoft.net/jodit/)
7777
8219
  * Released under MIT see LICENSE.txt in the project root for license information.
7778
8220
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
7779
8221
  */ /**
7780
8222
  * @module helpers/string
7781
- */
8223
+ */ const SPACE = /[\s\u200b]/;
8224
+ const INVISIBLE = /\uFEFF/;
8225
+ // Cut the chars matching `char` from both ends; `[…]+$` backtracks on a long run that is not at the end
8226
+ function trimBy(value, char) {
8227
+ let start = 0;
8228
+ let end = value.length;
8229
+ while(start < end && char.test(value.charAt(start))){
8230
+ start += 1;
8231
+ }
8232
+ while(end > start && char.test(value.charAt(end - 1))){
8233
+ end -= 1;
8234
+ }
8235
+ return start === 0 && end === value.length ? value : value.slice(start, end);
8236
+ }
7782
8237
  /**
7783
8238
  * It clears the line of all auxiliary invisible characters , from the spaces and line breaks , tabs
7784
8239
  * from the beginning and end of the line
7785
8240
  */ function trim(value) {
7786
- return value.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.SPACE_REG_EXP_END)(), '').replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.SPACE_REG_EXP_START)(), '');
8241
+ return trimBy(value, SPACE);
7787
8242
  }
7788
8243
  function trimChars(value, chars) {
7789
- return value.replace(RegExp(`[${chars}]+$`), '').replace(RegExp(`^[${chars}]+`), '');
8244
+ return trimBy(value, RegExp(`[${chars}]`));
7790
8245
  }
7791
8246
  /**
7792
8247
  * Trim only invisible chars
7793
8248
  */ function trimInv(value) {
7794
- return value.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_END)(), '').replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)(), '');
8249
+ return trimBy(value, INVISIBLE);
8250
+ }
8251
+ /**
8252
+ * Without the invisible chars at the end
8253
+ */ function trimInvEnd(value) {
8254
+ let end = value.length;
8255
+ while(end > 0 && INVISIBLE.test(value.charAt(end - 1))){
8256
+ end -= 1;
8257
+ }
8258
+ return end === value.length ? value : value.slice(0, end);
7795
8259
  }
7796
8260
 
7797
8261
 
@@ -11151,18 +11615,19 @@ function usable(ranges, shadowRoot) {
11151
11615
 
11152
11616
  "use strict";
11153
11617
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11154
- /* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_2__.composedRanges; },
11618
+ /* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_3__.composedRanges; },
11155
11619
  /* harmony export */ cursorInTheEdgeOfString: function() { return /* binding */ cursorInTheEdgeOfString; },
11156
11620
  /* harmony export */ findCorrectCurrentNode: function() { return /* binding */ findCorrectCurrentNode; },
11157
- /* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_3__.isMoved; },
11158
- /* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__.moveNodeInsideStart; }
11621
+ /* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_4__.isMoved; },
11622
+ /* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_5__.moveNodeInsideStart; }
11159
11623
  /* harmony export */ });
11160
11624
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
11161
11625
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
11162
- /* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43134);
11163
- /* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(90657);
11164
- /* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89817);
11165
- /* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7470);
11626
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
11627
+ /* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43134);
11628
+ /* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90657);
11629
+ /* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89817);
11630
+ /* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7470);
11166
11631
  /*!
11167
11632
  * Jodit Editor (https://xdsoft.net/jodit/)
11168
11633
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -11175,6 +11640,7 @@ function usable(ranges, shadowRoot) {
11175
11640
 
11176
11641
 
11177
11642
 
11643
+
11178
11644
  /**
11179
11645
  * Despite the name, returns `true` when the cursor is NOT at the checked edge
11180
11646
  * of the text node: there is significant (non invisible-space) text between
@@ -11182,7 +11648,7 @@ function usable(ranges, shadowRoot) {
11182
11648
  * @private
11183
11649
  */ function cursorInTheEdgeOfString(container, offset, start, end) {
11184
11650
  const text = container.nodeValue?.length ? container.nodeValue : '';
11185
- if (end && text.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_END)(), '').length > offset) {
11651
+ if (end && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trimInvEnd)(text).length > offset) {
11186
11652
  return true;
11187
11653
  }
11188
11654
  const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
@@ -15557,6 +16023,18 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
15557
16023
  render() {
15558
16024
  return '<div><div class="&__content"></div></div>';
15559
16025
  }
16026
+ get __isEnabled() {
16027
+ const { o } = this.j;
16028
+ return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
16029
+ }
16030
+ /**
16031
+ * Show tooltips for the buttons in an element outside the editor's
16032
+ * container, such as a toolbar placed by the `toolbar` option
16033
+ */ attach(container) {
16034
+ if (this.__isEnabled) {
16035
+ this.__onAttach(container);
16036
+ }
16037
+ }
15560
16038
  __onAttach(container) {
15561
16039
  // TODO Move it inside __show method. Now it is here because testcase failed with capturing
15562
16040
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(this.j, UITooltip), this.container);
@@ -15691,7 +16169,7 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
15691
16169
  }
15692
16170
  constructor(view){
15693
16171
  super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isOpened", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__attachedContainers", new Set()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__listenClose", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__currentTarget", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__delayShowTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hideTimeout", 0);
15694
- if (!view.o.textIcons && view.o.showTooltip && !view.o.useNativeTooltip) {
16172
+ if (this.__isEnabled) {
15695
16173
  this.j.e.on('getContainer', (box)=>{
15696
16174
  this.__onAttach(box);
15697
16175
  });
@@ -18010,7 +18488,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
18010
18488
  return;
18011
18489
  }
18012
18490
  const buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__.splitArray)(this.o.buttons) : [];
18013
- this.toolbar?.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(this.toolbarContainer);
18491
+ const container = this.toolbarContainer;
18492
+ this.toolbar?.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(container);
18493
+ // The toolbar's own element, as editors can share the one it is placed in
18494
+ if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isOrContains(this.container, container)) {
18495
+ this.__tooltip.attach(this.toolbar.container);
18496
+ }
18014
18497
  }
18015
18498
  getRegisteredButtonGroups() {
18016
18499
  return this.groupToButtons;
@@ -18419,11 +18902,12 @@ View.defaultOptions = {
18419
18902
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
18420
18903
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
18421
18904
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
18422
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
18423
- /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(73714);
18424
- /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80512);
18425
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5266);
18426
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(60936);
18905
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
18906
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
18907
+ /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73714);
18908
+ /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80512);
18909
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5266);
18910
+ /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60936);
18427
18911
  /*!
18428
18912
  * Jodit Editor (https://xdsoft.net/jodit/)
18429
18913
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -18444,6 +18928,7 @@ View.defaultOptions = {
18444
18928
 
18445
18929
 
18446
18930
 
18931
+
18447
18932
  const FOCUS_EVENTS = new Set([
18448
18933
  'focus',
18449
18934
  'blur',
@@ -18473,7 +18958,7 @@ const NOEDIT = {
18473
18958
  * The editor's options, with the deprecated `imageAlignClasses` copied into
18474
18959
  * `alignClasses.img` when that isn't set
18475
18960
  */ function makeOptions(options) {
18476
- const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions);
18961
+ const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions);
18477
18962
  if (opt.imageAlignClasses && !opt.alignClasses?.img) {
18478
18963
  opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)({
18479
18964
  img: opt.imageAlignClasses
@@ -18481,7 +18966,7 @@ const NOEDIT = {
18481
18966
  }
18482
18967
  return opt;
18483
18968
  }
18484
- class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar {
18969
+ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar {
18485
18970
  /** @override */ className() {
18486
18971
  return 'Jodit';
18487
18972
  }
@@ -18524,7 +19009,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18524
19009
  * Return a default timeout period in milliseconds for some debounce or throttle functions.
18525
19010
  * By default, `{history.timeout}` options
18526
19011
  */ get defaultTimeout() {
18527
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout : jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions.defaultTimeout;
19012
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout : jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions.defaultTimeout;
18528
19013
  }
18529
19014
  /**
18530
19015
  * Method wrap usual object in Object helper for prevent deep object merging in options*
@@ -18554,7 +19039,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18554
19039
  /**
18555
19040
  * Default settings
18556
19041
  */ static get defaultOptions() {
18557
- return jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions;
19042
+ return jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions;
18558
19043
  }
18559
19044
  /**
18560
19045
  * Deep-merges partial options into the global defaults without replacing
@@ -18602,7 +19087,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18602
19087
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigMerge)(Jodit.defaultOptions, options);
18603
19088
  }
18604
19089
  get createInside() {
18605
- return new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Create(()=>this.ed, this.o.createAttributes);
19090
+ return new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Create(()=>this.ed, this.o.createAttributes);
18606
19091
  }
18607
19092
  __setPlaceField(field, value) {
18608
19093
  if (!this.currentPlace) {
@@ -18802,7 +19287,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18802
19287
  }
18803
19288
  value = this.getNativeEditorValue().replace(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INVISIBLE_SPACE_REG_EXP(), '');
18804
19289
  if (removeSelectionMarkers) {
18805
- value = value.replace(/<span[^>]+id="jodit-selection_marker_[^>]+><\/span>/g, '');
19290
+ value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags)(value, 'span', 'id="jodit-selection_marker_');
18806
19291
  }
18807
19292
  if (value === '<br>') {
18808
19293
  value = '';
@@ -19116,7 +19601,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19116
19601
  return this.getMode();
19117
19602
  }
19118
19603
  const active = this.od.activeElement;
19119
- if (active && (active === this.iframe || jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(this.editor, active) || jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(this.toolbar.container, active))) {
19604
+ if (active && (active === this.iframe || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(this.editor, active) || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(this.toolbar.container, active))) {
19120
19605
  return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_WYSIWYG;
19121
19606
  }
19122
19607
  return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE;
@@ -19269,7 +19754,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19269
19754
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(element.attributes).forEach((attr)=>{
19270
19755
  const name = attr.name;
19271
19756
  let value = attr.value;
19272
- if (jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
19757
+ if (jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
19273
19758
  if ([
19274
19759
  'readonly',
19275
19760
  'disabled'
@@ -19306,7 +19791,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19306
19791
  container = element;
19307
19792
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultClassesKey, element.className.toString());
19308
19793
  buffer = container.innerHTML;
19309
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.detach(container);
19794
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.detach(container);
19310
19795
  }
19311
19796
  container.classList.add('jodit_inline');
19312
19797
  container.classList.add('jodit-container');
@@ -19314,7 +19799,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19314
19799
  // actual for inline mode
19315
19800
  if (element !== container) {
19316
19801
  // hide source element
19317
- const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.cssInline)(element, 'display');
19802
+ const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display');
19318
19803
  if (display) {
19319
19804
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultStyleDisplayKey, display);
19320
19805
  }
@@ -19326,21 +19811,21 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19326
19811
  // the toolbar box below it when (re)attaching the toolbar container.
19327
19812
  const aboveSlot = this.c.div(this.getFullElName(SLOT, 'above'), NOEDIT);
19328
19813
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(aboveSlot, 'data-jodit-above-toolbar', '');
19329
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.appendChildFirst(container, aboveSlot);
19814
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.appendChildFirst(container, aboveSlot);
19330
19815
  const topSlot = this.c.div(this.getFullElName(SLOT, 'top'), NOEDIT);
19331
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(container, topSlot);
19816
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, topSlot);
19332
19817
  const centerSlot = this.c.div(this.getFullElName(SLOT, 'center'), NOEDIT);
19333
19818
  const workplace = this.c.div('jodit-workplace', NOEDIT);
19334
19819
  const leftSlot = this.c.div(this.getFullElName(SLOT, 'left'), NOEDIT);
19335
19820
  const rightSlot = this.c.div(this.getFullElName(SLOT, 'right'), NOEDIT);
19336
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(centerSlot, leftSlot);
19337
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(centerSlot, workplace);
19338
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(centerSlot, rightSlot);
19339
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(container, centerSlot);
19821
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, leftSlot);
19822
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, workplace);
19823
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, rightSlot);
19824
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, centerSlot);
19340
19825
  const bottomPanel = this.c.div(this.getFullElName(SLOT, 'bottom'), NOEDIT);
19341
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(container, bottomPanel);
19826
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, bottomPanel);
19342
19827
  if (element.parentNode && element !== container) {
19343
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.before(element, container);
19828
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.before(element, container);
19344
19829
  }
19345
19830
  Object.defineProperty(element, 'component', {
19346
19831
  enumerable: false,
@@ -19352,7 +19837,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19352
19837
  'aria-disabled': false,
19353
19838
  tabindex: this.o.tabIndex
19354
19839
  });
19355
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(workplace, editor);
19840
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(workplace, editor);
19356
19841
  const currentPlace = {
19357
19842
  editor,
19358
19843
  element,
@@ -19366,9 +19851,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19366
19851
  left: leftSlot,
19367
19852
  right: rightSlot
19368
19853
  },
19369
- statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.StatusBar(this, container),
19854
+ statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.StatusBar(this, container),
19370
19855
  options: this.isReady ? makeOptions(options) : this.options,
19371
- history: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.History(this),
19856
+ history: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.History(this),
19372
19857
  editorWindow: this.ow
19373
19858
  };
19374
19859
  this.__elementToPlace.set(editor, currentPlace);
@@ -19400,7 +19885,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19400
19885
  return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(initResult, init);
19401
19886
  }
19402
19887
  addDisclaimer(elm) {
19403
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(this.workplace, elm);
19888
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(this.workplace, elm);
19404
19889
  }
19405
19890
  /**
19406
19891
  * Set current place object
@@ -19463,7 +19948,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19463
19948
  return;
19464
19949
  }
19465
19950
  if (stayDefault === false || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isPromise)(stayDefault)) {
19466
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(defaultEditorArea);
19951
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(defaultEditorArea);
19467
19952
  }
19468
19953
  addClassNames(this.o.editorClassName, this.editor);
19469
19954
  if (this.o.style) {
@@ -19512,7 +19997,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19512
19997
  // and such an element stays in the editor
19513
19998
  if (FOCUS_EVENTS.has(type)) {
19514
19999
  const inner = type === 'focusin' || type === 'focusout';
19515
- if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(editor, event.relatedTarget)) {
20000
+ if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(editor, event.relatedTarget)) {
19516
20001
  return;
19517
20002
  }
19518
20003
  if (inner) {
@@ -19549,7 +20034,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19549
20034
  });
19550
20035
  }
19551
20036
  fetch(url, options) {
19552
- const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_7__.Ajax({
20037
+ const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_8__.Ajax({
19553
20038
  url,
19554
20039
  ...options
19555
20040
  }, this.o.defaultAjaxOptions);
@@ -19570,7 +20055,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19570
20055
  if (this.isInDestruct) {
19571
20056
  return;
19572
20057
  }
19573
- this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_10__.STATUSES.beforeDestruct);
20058
+ this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeDestruct);
19574
20059
  this.__elementToPlace.clear();
19575
20060
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'storage')?.clear();
19576
20061
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'buffer')?.clear();
@@ -19608,17 +20093,17 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19608
20093
  this.e.off(container);
19609
20094
  this.e.off(element);
19610
20095
  this.e.off(editor);
19611
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(workplace);
19612
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(editor);
20096
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(workplace);
20097
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(editor);
19613
20098
  if (container !== element) {
19614
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(container);
20099
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(container);
19615
20100
  }
19616
20101
  Object.defineProperty(element, 'component', {
19617
20102
  enumerable: false,
19618
20103
  configurable: true,
19619
20104
  value: null
19620
20105
  });
19621
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(iframe);
20106
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(iframe);
19622
20107
  // inline mode
19623
20108
  if (container === element) {
19624
20109
  element.innerHTML = tmpValue;
@@ -19663,7 +20148,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19663
20148
  this.destruct();
19664
20149
  throw e;
19665
20150
  }
19666
- this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_10__.STATUSES.beforeInit);
20151
+ this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeInit);
19667
20152
  this.id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.resolveElement)(element, this.o.shadowRoot || this.od), 'id') || new Date().getTime().toString();
19668
20153
  jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances[this.id] = this;
19669
20154
  this.attachEvents(options);
@@ -19673,7 +20158,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19673
20158
  }
19674
20159
  });
19675
20160
  this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
19676
- this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Selection(this);
20161
+ this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Selection(this);
19677
20162
  const beforeInitHookResult = this.beforeInitHook();
19678
20163
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(beforeInitHookResult, ()=>{
19679
20164
  if (this.isInDestruct) {
@@ -19697,7 +20182,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19697
20182
  this.e.fire('afterInit', this);
19698
20183
  }
19699
20184
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(this.afterInitHook());
19700
- this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_10__.STATUSES.ready);
20185
+ this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.ready);
19701
20186
  this.e.fire('afterConstructor', this);
19702
20187
  };
19703
20188
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(addPlaceResult, init);
@@ -19713,7 +20198,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19713
20198
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances);
19714
20199
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.lang);
19715
20200
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
19716
- Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Plugin
20201
+ Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin
19717
20202
  });
19718
20203
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
19719
20204
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cache
@@ -19740,7 +20225,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19740
20225
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
19741
20226
  ], Jodit.prototype, "__prepareWYSIWYGEditor", null);
19742
20227
  Jodit = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
19743
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_8__.Dlgs)
20228
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__.Dlgs)
19744
20229
  ], Jodit);
19745
20230
  function addClassNames(className, elm) {
19746
20231
  if (className) {
@@ -27970,6 +28455,17 @@ const ns = 'addnewline';
27970
28455
  editor.editor
27971
28456
  ], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
27972
28457
  }
28458
+ /**
28459
+ * An empty line with a `<br>`, as Enter makes, so it keeps its height
28460
+ * without clean-html's fillEmptyParagraph (#1807)
28461
+ */ __newLine() {
28462
+ const { j } = this;
28463
+ const line = j.createInside.element(j.o.enter);
28464
+ if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(line, 'br')) {
28465
+ jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(line, j.createInside.element('br'));
28466
+ }
28467
+ return line;
28468
+ }
27973
28469
  /**
27974
28470
  * A paragraph holding only an embed has no place for the caret, so the
27975
28471
  * arrow keys can't get past one that ends the content, or before one that
@@ -27982,6 +28478,11 @@ const ns = 'addnewline';
27982
28478
  return;
27983
28479
  }
27984
28480
  const { startContainer, startOffset } = editor.s.range;
28481
+ // A caret in the editor itself, as beside a horizontal line, is in no
28482
+ // paragraph, and the browsers can leave it there with text beyond (#1803)
28483
+ if (startContainer === editor.editor) {
28484
+ return;
28485
+ }
27985
28486
  // Once the browser has moved the caret, if it could. With a 0 timeout
27986
28487
  // Jodit would run this at once, before the browser moves it
27987
28488
  editor.async.setTimeout(()=>{
@@ -27990,7 +28491,7 @@ const ns = 'addnewline';
27990
28491
  if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
27991
28492
  return;
27992
28493
  }
27993
- const p = editor.createInside.element(editor.o.enter);
28494
+ const p = this.__newLine();
27994
28495
  forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
27995
28496
  editor.s.setCursorIn(p);
27996
28497
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
@@ -28002,7 +28503,7 @@ const ns = 'addnewline';
28002
28503
  if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
28003
28504
  const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
28004
28505
  const top = e.pageY - editor.ew.scrollX;
28005
- const p = editor.createInside.element(editor.o.enter);
28506
+ const p = this.__newLine();
28006
28507
  if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
28007
28508
  jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
28008
28509
  } else {
@@ -28086,7 +28587,7 @@ const ns = 'addnewline';
28086
28587
  return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
28087
28588
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
28088
28589
  const editor = this.j;
28089
- const p = editor.createInside.element(editor.o.enter);
28590
+ const p = this.__newLine();
28090
28591
  if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
28091
28592
  if (this.__current === editor.editor) {
28092
28593
  jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
@@ -32768,7 +33269,18 @@ const KEEPS_SPACES = new Set([
32768
33269
  /**
32769
33270
  * A plain space beside this neighbor isn't shown: there is none, or it's a
32770
33271
  * line break, a block or text starting (or ending) with a plain space
32771
- */ function hidesSpace(neighbor, edge) {
33272
+ */ // The run of spaces at the end (or the start) of the text becomes nbsp; counted, as `/ +$/` backtracks on a long run
33273
+ function replaceEdgeSpaces(text, atEnd) {
33274
+ let count = 0;
33275
+ while(count < text.length && text.charAt(atEnd ? text.length - 1 - count : count) === ' '){
33276
+ count += 1;
33277
+ }
33278
+ if (count === 0) {
33279
+ return text;
33280
+ }
33281
+ return atEnd ? text.slice(0, text.length - count) + jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.NBSP_SPACE.repeat(count) : jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.NBSP_SPACE.repeat(count) + text.slice(count);
33282
+ }
33283
+ function hidesSpace(neighbor, edge) {
32772
33284
  return !neighbor || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(neighbor, 'br') || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock(neighbor) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(neighbor) && edge.test(neighbor.nodeValue ?? '');
32773
33285
  }
32774
33286
  class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
@@ -32808,6 +33320,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
32808
33320
  }
32809
33321
  jodit.s.expandSelection();
32810
33322
  const range = jodit.s.range;
33323
+ this.__moveEdgesIntoCells(range);
32811
33324
  const caret = this.__clearSelectedCells(range);
32812
33325
  if (caret && range.collapsed) {
32813
33326
  jodit.s.selectRange(caret);
@@ -32829,6 +33342,22 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
32829
33342
  jodit.s.selectRange(caret ?? range);
32830
33343
  return false;
32831
33344
  }
33345
+ /**
33346
+ * Firefox selects cells whole from their row, as after a drag into or out
33347
+ * of a table nested in a cell, and `deleteContents` would remove them. The
33348
+ * edges move into the cells, so their content is cleared instead, as in
33349
+ * Firefox's own delete
33350
+ */ __moveEdgesIntoCells(range) {
33351
+ const { startContainer, startOffset, endContainer, endOffset } = range;
33352
+ const first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
33353
+ const last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
33354
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(first)) {
33355
+ range.setStart(first, 0);
33356
+ }
33357
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(last)) {
33358
+ range.setEnd(last, last.childNodes.length);
33359
+ }
33360
+ }
32832
33361
  /**
32833
33362
  * A selection that starts or ends in a table cell clears the selected part
32834
33363
  * of each cell it covers and keeps the cells, as the browsers do.
@@ -32951,10 +33480,10 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
32951
33480
  const before = this.__findNeighbor(fake, true, block);
32952
33481
  const after = this.__findNeighbor(fake, false, block);
32953
33482
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) && hidesSpace(after, /^ /)) {
32954
- before.nodeValue = before.nodeValue.replace(/ +$/, (spaces)=>jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.NBSP_SPACE.repeat(spaces.length));
33483
+ before.nodeValue = replaceEdgeSpaces(before.nodeValue, true);
32955
33484
  }
32956
33485
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(after) && hidesSpace(before, / $/)) {
32957
- after.nodeValue = after.nodeValue.replace(/^ +/, (spaces)=>jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.NBSP_SPACE.repeat(spaces.length));
33486
+ after.nodeValue = replaceEdgeSpaces(after.nodeValue, false);
32958
33487
  }
32959
33488
  }
32960
33489
  /**
@@ -35944,6 +36473,11 @@ function hr(editor) {
35944
36473
  return false;
35945
36474
  }
35946
36475
  const p = editor.createInside.element(editor.o.enter);
36476
+ // As Enter's new line has, so it keeps its height without clean-html's
36477
+ // fillEmptyParagraph (#1807)
36478
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
36479
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
36480
+ }
35947
36481
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
35948
36482
  editor.s.setCursorIn(p);
35949
36483
  return false;
@@ -35986,7 +36520,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
35986
36520
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
35987
36521
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
35988
36522
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
35989
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17326);
36523
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
36524
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17326);
35990
36525
  /*!
35991
36526
  * Jodit Editor (https://xdsoft.net/jodit/)
35992
36527
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -36001,6 +36536,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
36001
36536
 
36002
36537
 
36003
36538
 
36539
+
36004
36540
  /**
36005
36541
  * Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
36006
36542
  * in backend of you system
@@ -36059,13 +36595,66 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
36059
36595
  const toggleEditable = ()=>{
36060
36596
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(doc.body, 'contenteditable', editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && !editor.getReadOnly() || null);
36061
36597
  };
36598
+ // The start of the whitespace run that ends at `to`
36599
+ const skipBack = (text, to)=>{
36600
+ while(to > 0 && /\s/.test(text.charAt(to - 1))){
36601
+ to -= 1;
36602
+ }
36603
+ return to;
36604
+ };
36605
+ // The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
36606
+ const cleanBodyTag = (tag)=>{
36607
+ tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
36608
+ const skip = (from, chars)=>{
36609
+ while(chars.test(tag.charAt(from))){
36610
+ from += 1;
36611
+ }
36612
+ return from;
36613
+ };
36614
+ let index = tag.indexOf('contenteditable');
36615
+ while(index !== -1){
36616
+ let to = skip(index + 'contenteditable'.length, /["'\s]/);
36617
+ if (tag.charAt(to) === '=') {
36618
+ to = skip(to + 1, /[\s"']/);
36619
+ if (tag.startsWith('true', to)) {
36620
+ to = skip(to + 4, /["']/);
36621
+ let from = index;
36622
+ if (/["']/.test(tag.charAt(from - 1))) {
36623
+ from -= 1;
36624
+ }
36625
+ from = skipBack(tag, from);
36626
+ return tag.slice(0, from) + tag.slice(to);
36627
+ }
36628
+ }
36629
+ index = tag.indexOf('contenteditable', index + 1);
36630
+ }
36631
+ return tag;
36632
+ };
36062
36633
  const clearMarkers = (html)=>{
36063
36634
  // The plugins' own styles, from `getContainer`, aren't part of the value
36064
- html = html.replace(/<style[^>]+jodit-box[^>]*>[\s\S]*?<\/style>/gi, '');
36065
- const bodyReg = /<body.*<\/body>/im, bodyMarker = '{%%BODY%%}', body = bodyReg.exec(html);
36066
- if (body) {
36067
- // remove markers
36068
- html = html.replace(bodyReg, bodyMarker).replace(/<span([^>]*?)>(.*?)<\/span>/gim, '').replace(/&lt;span([^&]*?)&gt;(.*?)&lt;\/span&gt;/gim, '').replace(bodyMarker, body[0].replace(/(<body[^>]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im, '$1').replace(/(<body[^>]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im, '$1').replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g, '')).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g, '$1$2$3$5').replace(/(<[^<]+?)\sclass="[\s]*"/gim, '$1').replace(/(<[^<]+?)\sstyle="[\s;]*"/gim, '$1').replace(/(<[^<]+?)\sdir="[\s]*"/gim, '$1');
36635
+ html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(html, '<style', '>', '</style>', 'jodit-box');
36636
+ const bodyStart = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag)(html, 'body');
36637
+ let bodyEnd = -1;
36638
+ for(let index = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag)(html, 'body', bodyStart + 1); index !== -1; index = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag)(html, 'body', index + 1)){
36639
+ bodyEnd = index;
36640
+ }
36641
+ if (bodyStart !== -1 && bodyEnd !== -1) {
36642
+ const afterBody = bodyEnd + '</body>'.length;
36643
+ const gt = html.indexOf('>', bodyStart);
36644
+ let body = html.slice(bodyStart, afterBody);
36645
+ if (gt !== -1 && gt < bodyEnd) {
36646
+ body = cleanBodyTag(html.slice(bodyStart, gt)) + html.slice(gt, afterBody);
36647
+ }
36648
+ for (const tag of [
36649
+ 'style',
36650
+ 'script',
36651
+ 'span'
36652
+ ]){
36653
+ body = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
36654
+ }
36655
+ // remove markers: the spans outside the body are the editor's own
36656
+ const stripSpans = (part)=>(0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)((0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(part, '<span', '>', '</span>'), '&lt;span', '&gt;', '&lt;/span&gt;');
36657
+ html = (stripSpans(html.slice(0, bodyStart)) + body + stripSpans(html.slice(afterBody))).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g, '$1$2$3$5').replace(/(<[^<]+?)\sclass="[\s]*"/gim, '$1').replace(/(<[^<]+?)\sstyle="[\s;]*"/gim, '$1').replace(/(<[^<]+?)\sdir="[\s]*"/gim, '$1');
36069
36658
  }
36070
36659
  return html;
36071
36660
  };
@@ -41932,9 +42521,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
41932
42521
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
41933
42522
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
41934
42523
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
41935
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
41936
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80991);
41937
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51730);
42524
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
42525
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
42526
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
42527
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
41938
42528
  /*!
41939
42529
  * Jodit Editor (https://xdsoft.net/jodit/)
41940
42530
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -41949,16 +42539,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
41949
42539
 
41950
42540
 
41951
42541
 
42542
+
41952
42543
  /**
41953
42544
  * Process `video` and `audio`
41954
42545
  */ function media(editor) {
41955
42546
  const keyFake = 'jodit_fake_wrapper';
41956
42547
  const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
41957
42548
  const wrap = (element)=>{
41958
- if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
42549
+ if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
41959
42550
  element = element.parentNode;
41960
42551
  } else if (mediaWrappers[element.nodeName.toLowerCase()]) {
41961
- element = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.getMediaWrapper)(editor, element) ?? (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.wrapMedia)(editor, element);
42552
+ element = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, element) ?? (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.wrapMedia)(editor, element);
41962
42553
  } else if (mediaInFakeBlock) {
41963
42554
  const media = element;
41964
42555
  const wrapper = editor.createInside.element(mediaFakeTag, {
@@ -41967,13 +42558,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
41967
42558
  draggable: true,
41968
42559
  [`data-${keyFake}`]: 1
41969
42560
  });
41970
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element, 'style'));
42561
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
41971
42562
  // The wrapper fits the media, whose size changes as its metadata loads
41972
- // and as it's resized. A percentage width is of the line, so it takes that
42563
+ // and as it's resized. It's inline, as the media is by default, so the
42564
+ // line's text-align still places it, or a block when the media is one.
42565
+ // A percentage width is of the line, so the wrapper is a block that
42566
+ // takes the line, and the media in it follows the text-align it inherits
41973
42567
  const fit = ()=>{
41974
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(wrapper, {
41975
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
41976
- width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
42568
+ const ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%');
42569
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
42570
+ display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(media, 'display').toString()) ? 'inline-block' : 'block',
42571
+ width: ofLine ? '' : 'fit-content',
41977
42572
  height: ''
41978
42573
  });
41979
42574
  };
@@ -42010,15 +42605,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
42010
42605
  }
42011
42606
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
42012
42607
  editor.e.on('afterGetValueFromEditor', (data)=>{
42013
- const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
42014
- if (rxp.test(data.value)) {
42015
- data.value = data.value.replace(rxp, '$1');
42016
- }
42608
+ data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.unwrapMarkedTags)(data.value, mediaFakeTag, `data-${keyFake}`);
42017
42609
  }).on('change afterInit afterSetMode changePlace', editor.async.debounce(()=>{
42018
42610
  if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE) {
42019
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
42020
- if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.dataBind)(elm, keyFake)) {
42021
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.dataBind)(elm, keyFake, true);
42611
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
42612
+ if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
42613
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
42022
42614
  wrap(elm);
42023
42615
  }
42024
42616
  });
@@ -42999,7 +43591,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
42999
43591
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
43000
43592
  /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
43001
43593
  /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
43002
- /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53681);
43594
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
43595
+ /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
43003
43596
  /*!
43004
43597
  * Jodit Editor (https://xdsoft.net/jodit/)
43005
43598
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43011,11 +43604,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43011
43604
 
43012
43605
 
43013
43606
 
43607
+
43014
43608
  /**
43015
43609
  * Remove special HTML comments
43016
43610
  * @private
43017
43611
  */ function removeExtraFragments(html) {
43018
- html = html.replace(/<meta[^>]+?>/g, '');
43612
+ html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix)(html, [
43613
+ '<meta'
43614
+ ]);
43019
43615
  const start = html.search(/<!--StartFragment-->/i);
43020
43616
  if (start !== -1) {
43021
43617
  html = html.substring(start + 20);
@@ -43033,7 +43629,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43033
43629
  * paste bold
43034
43630
  * @private
43035
43631
  */ function removeGoogleDocsWrapper(html) {
43036
- if (!/<b\s[^>]*docs-internal-guid-/i.test(html)) {
43632
+ // A plain search: the wrapper check is left to the parsed document below
43633
+ if (!/docs-internal-guid-/i.test(html)) {
43037
43634
  return html;
43038
43635
  }
43039
43636
  // An inert document: images don't load and handlers don't run
@@ -43088,7 +43685,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43088
43685
  return;
43089
43686
  }
43090
43687
  const dialog = jodit.confirm(`<div style="word-break: normal; white-space: normal">${jodit.i18n(msg)}</div>`, jodit.i18n(title));
43091
- const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
43688
+ const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
43092
43689
  text,
43093
43690
  name: text.toLowerCase(),
43094
43691
  tabIndex: 0
@@ -43104,7 +43701,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43104
43701
  }
43105
43702
  jodit.e.fire('afterClosePasteDialog', dialog);
43106
43703
  });
43107
- const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
43704
+ const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
43108
43705
  text: 'Cancel',
43109
43706
  tabIndex: 0
43110
43707
  }).onAction(()=>{
@@ -44612,12 +45209,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
44612
45209
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
44613
45210
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
44614
45211
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
44615
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
44616
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
44617
- /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42259);
44618
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4099);
44619
- /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(56490);
44620
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(96608);
45212
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
45213
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
45214
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
45215
+ /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42259);
45216
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
45217
+ /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(56490);
45218
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(96608);
44621
45219
  /*!
44622
45220
  * Jodit Editor (https://xdsoft.net/jodit/)
44623
45221
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -44641,6 +45239,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
44641
45239
 
44642
45240
 
44643
45241
 
45242
+
44644
45243
  const keyBInd = '__jodit-resizer_binded';
44645
45244
  /**
44646
45245
  * Reads a plain pixel value out of a `width`/`height` attribute.
@@ -44657,7 +45256,7 @@ const keyBInd = '__jodit-resizer_binded';
44657
45256
  * A video with no height of its own takes it from its width and its ratio,
44658
45257
  * so resizing it keeps the ratio without setting a height.
44659
45258
  */ function heightFollowsWidth(element) {
44660
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'height');
45259
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'height');
44661
45260
  }
44662
45261
  const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44663
45262
  /**
@@ -44667,7 +45266,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44667
45266
  */ const EMBED_WRAPPER_STYLE = `${IFRAME_WRAPPER}{position:relative;display:block;user-select:none}` + `${IFRAME_WRAPPER} iframe{position:relative}` + `${IFRAME_WRAPPER}::after{position:absolute;z-index:1;display:block;background:transparent;content:'';cursor:pointer;inset:0}` + `${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:2}` + `.jodit_lock ${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:1}`;
44668
45267
  /**
44669
45268
  * The module creates a supporting frame for resizing of the elements img and table
44670
- */ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
45269
+ */ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
44671
45270
  /** @override */ afterInit(editor) {
44672
45271
  // It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
44673
45272
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
@@ -44684,10 +45283,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44684
45283
  .on('keydown', this.onEditorKeyDown, {
44685
45284
  top: true
44686
45285
  }).on('afterGetValueFromEditor.resizer', (data)=>{
44687
- const rgx = /<jodit[^>]+data-jodit_iframe_wrapper[^>]+>(.*?<iframe[^>]*>.*?<\/iframe>.*?)<\/jodit>/gi;
44688
- if (rgx.test(data.value)) {
44689
- data.value = data.value.replace(rgx, '$1');
44690
- }
45286
+ data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__.unwrapMarkedTags)(data.value, 'jodit', 'data-jodit_iframe_wrapper', (inner)=>/<iframe/i.test(inner));
44691
45287
  });
44692
45288
  this.addEventListeners();
44693
45289
  this.__onChangeEditor();
@@ -44723,7 +45319,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44723
45319
  return;
44724
45320
  }
44725
45321
  const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width');
44726
- if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(image, 'width')) {
45322
+ if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(image, 'width')) {
44727
45323
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
44728
45324
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width', null);
44729
45325
  }
@@ -44847,7 +45443,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44847
45443
  __followCaret() {
44848
45444
  const before = this.__keyDownRange;
44849
45445
  this.__keyDownRange = null;
44850
- if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__.isMoved)(this.j, before)) {
45446
+ if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__.isMoved)(this.j, before)) {
44851
45447
  return;
44852
45448
  }
44853
45449
  if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
@@ -44882,7 +45478,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44882
45478
  if (!this.isResizeMode) {
44883
45479
  // A click in the element's popup, or in a list it opens, works on
44884
45480
  // the element, so it keeps its frame
44885
- if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__.Popup)) {
45481
+ if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__.Popup)) {
44886
45482
  return;
44887
45483
  }
44888
45484
  return this.hide();
@@ -44906,7 +45502,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44906
45502
  if (changeAttrs) {
44907
45503
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
44908
45504
  }
44909
- if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, key)) {
45505
+ if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, key)) {
44910
45506
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
44911
45507
  }
44912
45508
  }
@@ -44970,8 +45566,11 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44970
45566
  // is nothing measurable at all, let the wrapper size itself.
44971
45567
  const width = element.offsetWidth || attrPixelSize(element, 'width');
44972
45568
  const height = element.offsetHeight || attrPixelSize(element, 'height');
45569
+ // The wrapper takes the iframe's place in its line: inline, as an
45570
+ // iframe is by default, so the line's text-align still places it,
45571
+ // or a block when the iframe is one
44973
45572
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
44974
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
45573
+ display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
44975
45574
  });
44976
45575
  if (width) {
44977
45576
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
@@ -45089,7 +45688,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
45089
45688
  }
45090
45689
  if (this.element && this.rect) {
45091
45690
  const workplacePosition = this.getWorkplacePosition();
45092
- const pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.element, this.j, this.j.ed), left = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(this.rect, 'left') || '0', 10), top = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(this.rect, 'top') || '0', 10), w = this.rect.offsetWidth, h = this.rect.offsetHeight;
45691
+ const pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.element, this.j, this.j.ed), left = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(this.rect, 'left') || '0', 10), top = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(this.rect, 'top') || '0', 10), w = this.rect.offsetWidth, h = this.rect.offsetHeight;
45093
45692
  const newTop = pos.top - workplacePosition.top, newLeft = pos.left - workplacePosition.left;
45094
45693
  if (top !== newTop || left !== newLeft || w !== this.element.offsetWidth || h !== this.element.offsetHeight) {
45095
45694
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, {
@@ -46281,13 +46880,7 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
46281
46880
  if (this.j.isLockedNotBy(key)) {
46282
46881
  return;
46283
46882
  }
46284
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
46285
- // host, so the lookup must start from the shadow root
46286
- const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
46287
- const cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
46288
- 'td',
46289
- 'th'
46290
- ], table);
46883
+ const cell = this.__cellUnder(e, table);
46291
46884
  if (!cell || !this.__selectedCell) {
46292
46885
  return;
46293
46886
  }
@@ -46330,6 +46923,13 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
46330
46923
  this.__isSelectionMode = false;
46331
46924
  this.__selectedCell = null;
46332
46925
  }
46926
+ // The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
46927
+ __cellUnder(e, table) {
46928
+ // Inside Shadow DOM `document.elementFromPoint` returns the shadow
46929
+ // host, so the lookup must start from the shadow root
46930
+ const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
46931
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(elm, 'table', table), table);
46932
+ }
46333
46933
  /**
46334
46934
  * Stop a selection process
46335
46935
  */ __onStopSelection(table, e) {
@@ -46338,23 +46938,10 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
46338
46938
  }
46339
46939
  this.__isSelectionMode = false;
46340
46940
  this.j.unlock();
46341
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
46342
- // host, so the lookup must start from the shadow root
46343
- const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
46344
- if (!node) {
46345
- return;
46346
- }
46347
- const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
46348
- 'td',
46349
- 'th'
46350
- ], table);
46941
+ const cell = this.__cellUnder(e, table);
46351
46942
  if (!cell) {
46352
46943
  return;
46353
46944
  }
46354
- const ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', table);
46355
- if (ownTable && ownTable !== table) {
46356
- return; // Nested tables
46357
- }
46358
46945
  this.__showCellsPopup(table, [
46359
46946
  cell,
46360
46947
  this.__selectedCell