jodit 4.19.10 → 4.19.11

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 (76) hide show
  1. package/CHANGELOG.md +139 -131
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +7 -7
  4. package/es2015/jodit.js +703 -166
  5. package/es2015/jodit.min.js +7 -7
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +7 -7
  13. package/es2018/jodit.min.js +7 -7
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +13 -13
  18. package/es2021/jodit.js +703 -166
  19. package/es2021/jodit.min.js +13 -13
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +19 -19
  28. package/es2021.en/jodit.js +703 -166
  29. package/es2021.en/jodit.min.js +19 -19
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +731 -171
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/dom/dom.js +2 -2
  52. package/esm/core/helpers/checker/is-html-from-word.d.ts +4 -3
  53. package/esm/core/helpers/checker/is-html-from-word.js +94 -14
  54. package/esm/core/helpers/checker/is-html.d.ts +4 -0
  55. package/esm/core/helpers/checker/is-html.js +54 -2
  56. package/esm/core/helpers/html/apply-styles.js +20 -11
  57. package/esm/core/helpers/html/clean-from-word.js +2 -3
  58. package/esm/core/helpers/html/index.d.ts +1 -0
  59. package/esm/core/helpers/html/index.js +1 -0
  60. package/esm/core/helpers/html/tag-scan.d.ts +36 -0
  61. package/esm/core/helpers/html/tag-scan.js +257 -0
  62. package/esm/core/helpers/string/trim.d.ts +4 -0
  63. package/esm/core/helpers/string/trim.js +29 -10
  64. package/esm/core/selection/helpers/index.js +3 -2
  65. package/esm/jodit.js +2 -1
  66. package/esm/plugins/delete/delete.js +16 -2
  67. package/esm/plugins/iframe/iframe.js +59 -12
  68. package/esm/plugins/media/media.js +2 -4
  69. package/esm/plugins/paste/helpers.js +4 -2
  70. package/esm/plugins/resizer/resizer.js +2 -4
  71. package/package.json +1 -1
  72. package/types/core/helpers/checker/is-html-from-word.d.ts +4 -3
  73. package/types/core/helpers/checker/is-html.d.ts +4 -0
  74. package/types/core/helpers/html/index.d.ts +1 -0
  75. package/types/core/helpers/html/tag-scan.d.ts +36 -0
  76. package/types/core/helpers/string/trim.d.ts +4 -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.11
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.11";
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);
@@ -18419,11 +18885,12 @@ View.defaultOptions = {
18419
18885
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
18420
18886
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
18421
18887
  /* 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);
18888
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
18889
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
18890
+ /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73714);
18891
+ /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80512);
18892
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5266);
18893
+ /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60936);
18427
18894
  /*!
18428
18895
  * Jodit Editor (https://xdsoft.net/jodit/)
18429
18896
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -18444,6 +18911,7 @@ View.defaultOptions = {
18444
18911
 
18445
18912
 
18446
18913
 
18914
+
18447
18915
  const FOCUS_EVENTS = new Set([
18448
18916
  'focus',
18449
18917
  'blur',
@@ -18473,7 +18941,7 @@ const NOEDIT = {
18473
18941
  * The editor's options, with the deprecated `imageAlignClasses` copied into
18474
18942
  * `alignClasses.img` when that isn't set
18475
18943
  */ function makeOptions(options) {
18476
- const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions);
18944
+ const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions);
18477
18945
  if (opt.imageAlignClasses && !opt.alignClasses?.img) {
18478
18946
  opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)({
18479
18947
  img: opt.imageAlignClasses
@@ -18481,7 +18949,7 @@ const NOEDIT = {
18481
18949
  }
18482
18950
  return opt;
18483
18951
  }
18484
- class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar {
18952
+ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar {
18485
18953
  /** @override */ className() {
18486
18954
  return 'Jodit';
18487
18955
  }
@@ -18524,7 +18992,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18524
18992
  * Return a default timeout period in milliseconds for some debounce or throttle functions.
18525
18993
  * By default, `{history.timeout}` options
18526
18994
  */ 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;
18995
+ 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
18996
  }
18529
18997
  /**
18530
18998
  * Method wrap usual object in Object helper for prevent deep object merging in options*
@@ -18554,7 +19022,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18554
19022
  /**
18555
19023
  * Default settings
18556
19024
  */ static get defaultOptions() {
18557
- return jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions;
19025
+ return jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions;
18558
19026
  }
18559
19027
  /**
18560
19028
  * Deep-merges partial options into the global defaults without replacing
@@ -18602,7 +19070,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18602
19070
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigMerge)(Jodit.defaultOptions, options);
18603
19071
  }
18604
19072
  get createInside() {
18605
- return new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Create(()=>this.ed, this.o.createAttributes);
19073
+ return new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Create(()=>this.ed, this.o.createAttributes);
18606
19074
  }
18607
19075
  __setPlaceField(field, value) {
18608
19076
  if (!this.currentPlace) {
@@ -18802,7 +19270,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18802
19270
  }
18803
19271
  value = this.getNativeEditorValue().replace(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INVISIBLE_SPACE_REG_EXP(), '');
18804
19272
  if (removeSelectionMarkers) {
18805
- value = value.replace(/<span[^>]+id="jodit-selection_marker_[^>]+><\/span>/g, '');
19273
+ value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags)(value, 'span', 'id="jodit-selection_marker_');
18806
19274
  }
18807
19275
  if (value === '<br>') {
18808
19276
  value = '';
@@ -19116,7 +19584,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19116
19584
  return this.getMode();
19117
19585
  }
19118
19586
  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))) {
19587
+ 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
19588
  return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_WYSIWYG;
19121
19589
  }
19122
19590
  return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE;
@@ -19269,7 +19737,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19269
19737
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(element.attributes).forEach((attr)=>{
19270
19738
  const name = attr.name;
19271
19739
  let value = attr.value;
19272
- if (jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
19740
+ if (jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
19273
19741
  if ([
19274
19742
  'readonly',
19275
19743
  'disabled'
@@ -19306,7 +19774,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19306
19774
  container = element;
19307
19775
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultClassesKey, element.className.toString());
19308
19776
  buffer = container.innerHTML;
19309
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.detach(container);
19777
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.detach(container);
19310
19778
  }
19311
19779
  container.classList.add('jodit_inline');
19312
19780
  container.classList.add('jodit-container');
@@ -19314,7 +19782,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19314
19782
  // actual for inline mode
19315
19783
  if (element !== container) {
19316
19784
  // hide source element
19317
- const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.cssInline)(element, 'display');
19785
+ const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display');
19318
19786
  if (display) {
19319
19787
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultStyleDisplayKey, display);
19320
19788
  }
@@ -19326,21 +19794,21 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19326
19794
  // the toolbar box below it when (re)attaching the toolbar container.
19327
19795
  const aboveSlot = this.c.div(this.getFullElName(SLOT, 'above'), NOEDIT);
19328
19796
  (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);
19797
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.appendChildFirst(container, aboveSlot);
19330
19798
  const topSlot = this.c.div(this.getFullElName(SLOT, 'top'), NOEDIT);
19331
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(container, topSlot);
19799
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, topSlot);
19332
19800
  const centerSlot = this.c.div(this.getFullElName(SLOT, 'center'), NOEDIT);
19333
19801
  const workplace = this.c.div('jodit-workplace', NOEDIT);
19334
19802
  const leftSlot = this.c.div(this.getFullElName(SLOT, 'left'), NOEDIT);
19335
19803
  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);
19804
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, leftSlot);
19805
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, workplace);
19806
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, rightSlot);
19807
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, centerSlot);
19340
19808
  const bottomPanel = this.c.div(this.getFullElName(SLOT, 'bottom'), NOEDIT);
19341
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(container, bottomPanel);
19809
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, bottomPanel);
19342
19810
  if (element.parentNode && element !== container) {
19343
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.before(element, container);
19811
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.before(element, container);
19344
19812
  }
19345
19813
  Object.defineProperty(element, 'component', {
19346
19814
  enumerable: false,
@@ -19352,7 +19820,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19352
19820
  'aria-disabled': false,
19353
19821
  tabindex: this.o.tabIndex
19354
19822
  });
19355
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(workplace, editor);
19823
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(workplace, editor);
19356
19824
  const currentPlace = {
19357
19825
  editor,
19358
19826
  element,
@@ -19366,9 +19834,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19366
19834
  left: leftSlot,
19367
19835
  right: rightSlot
19368
19836
  },
19369
- statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.StatusBar(this, container),
19837
+ statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.StatusBar(this, container),
19370
19838
  options: this.isReady ? makeOptions(options) : this.options,
19371
- history: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.History(this),
19839
+ history: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.History(this),
19372
19840
  editorWindow: this.ow
19373
19841
  };
19374
19842
  this.__elementToPlace.set(editor, currentPlace);
@@ -19400,7 +19868,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19400
19868
  return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(initResult, init);
19401
19869
  }
19402
19870
  addDisclaimer(elm) {
19403
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.append(this.workplace, elm);
19871
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(this.workplace, elm);
19404
19872
  }
19405
19873
  /**
19406
19874
  * Set current place object
@@ -19463,7 +19931,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19463
19931
  return;
19464
19932
  }
19465
19933
  if (stayDefault === false || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isPromise)(stayDefault)) {
19466
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(defaultEditorArea);
19934
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(defaultEditorArea);
19467
19935
  }
19468
19936
  addClassNames(this.o.editorClassName, this.editor);
19469
19937
  if (this.o.style) {
@@ -19512,7 +19980,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19512
19980
  // and such an element stays in the editor
19513
19981
  if (FOCUS_EVENTS.has(type)) {
19514
19982
  const inner = type === 'focusin' || type === 'focusout';
19515
- if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(editor, event.relatedTarget)) {
19983
+ if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(editor, event.relatedTarget)) {
19516
19984
  return;
19517
19985
  }
19518
19986
  if (inner) {
@@ -19549,7 +20017,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19549
20017
  });
19550
20018
  }
19551
20019
  fetch(url, options) {
19552
- const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_7__.Ajax({
20020
+ const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_8__.Ajax({
19553
20021
  url,
19554
20022
  ...options
19555
20023
  }, this.o.defaultAjaxOptions);
@@ -19570,7 +20038,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19570
20038
  if (this.isInDestruct) {
19571
20039
  return;
19572
20040
  }
19573
- this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_10__.STATUSES.beforeDestruct);
20041
+ this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeDestruct);
19574
20042
  this.__elementToPlace.clear();
19575
20043
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'storage')?.clear();
19576
20044
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'buffer')?.clear();
@@ -19608,17 +20076,17 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19608
20076
  this.e.off(container);
19609
20077
  this.e.off(element);
19610
20078
  this.e.off(editor);
19611
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(workplace);
19612
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(editor);
20079
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(workplace);
20080
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(editor);
19613
20081
  if (container !== element) {
19614
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(container);
20082
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(container);
19615
20083
  }
19616
20084
  Object.defineProperty(element, 'component', {
19617
20085
  enumerable: false,
19618
20086
  configurable: true,
19619
20087
  value: null
19620
20088
  });
19621
- jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(iframe);
20089
+ jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(iframe);
19622
20090
  // inline mode
19623
20091
  if (container === element) {
19624
20092
  element.innerHTML = tmpValue;
@@ -19663,7 +20131,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19663
20131
  this.destruct();
19664
20132
  throw e;
19665
20133
  }
19666
- this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_10__.STATUSES.beforeInit);
20134
+ this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeInit);
19667
20135
  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
20136
  jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances[this.id] = this;
19669
20137
  this.attachEvents(options);
@@ -19673,7 +20141,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19673
20141
  }
19674
20142
  });
19675
20143
  this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
19676
- this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Selection(this);
20144
+ this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Selection(this);
19677
20145
  const beforeInitHookResult = this.beforeInitHook();
19678
20146
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(beforeInitHookResult, ()=>{
19679
20147
  if (this.isInDestruct) {
@@ -19697,7 +20165,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19697
20165
  this.e.fire('afterInit', this);
19698
20166
  }
19699
20167
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(this.afterInitHook());
19700
- this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_10__.STATUSES.ready);
20168
+ this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.ready);
19701
20169
  this.e.fire('afterConstructor', this);
19702
20170
  };
19703
20171
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(addPlaceResult, init);
@@ -19713,7 +20181,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19713
20181
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances);
19714
20182
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.lang);
19715
20183
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
19716
- Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Plugin
20184
+ Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin
19717
20185
  });
19718
20186
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
19719
20187
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cache
@@ -19740,7 +20208,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
19740
20208
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
19741
20209
  ], Jodit.prototype, "__prepareWYSIWYGEditor", null);
19742
20210
  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)
20211
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__.Dlgs)
19744
20212
  ], Jodit);
19745
20213
  function addClassNames(className, elm) {
19746
20214
  if (className) {
@@ -32768,7 +33236,18 @@ const KEEPS_SPACES = new Set([
32768
33236
  /**
32769
33237
  * A plain space beside this neighbor isn't shown: there is none, or it's a
32770
33238
  * line break, a block or text starting (or ending) with a plain space
32771
- */ function hidesSpace(neighbor, edge) {
33239
+ */ // The run of spaces at the end (or the start) of the text becomes nbsp; counted, as `/ +$/` backtracks on a long run
33240
+ function replaceEdgeSpaces(text, atEnd) {
33241
+ let count = 0;
33242
+ while(count < text.length && text.charAt(atEnd ? text.length - 1 - count : count) === ' '){
33243
+ count += 1;
33244
+ }
33245
+ if (count === 0) {
33246
+ return text;
33247
+ }
33248
+ 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);
33249
+ }
33250
+ function hidesSpace(neighbor, edge) {
32772
33251
  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
33252
  }
32774
33253
  class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
@@ -32951,10 +33430,10 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
32951
33430
  const before = this.__findNeighbor(fake, true, block);
32952
33431
  const after = this.__findNeighbor(fake, false, block);
32953
33432
  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));
33433
+ before.nodeValue = replaceEdgeSpaces(before.nodeValue, true);
32955
33434
  }
32956
33435
  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));
33436
+ after.nodeValue = replaceEdgeSpaces(after.nodeValue, false);
32958
33437
  }
32959
33438
  }
32960
33439
  /**
@@ -35986,7 +36465,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
35986
36465
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
35987
36466
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
35988
36467
  /* 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);
36468
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
36469
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17326);
35990
36470
  /*!
35991
36471
  * Jodit Editor (https://xdsoft.net/jodit/)
35992
36472
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -36001,6 +36481,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
36001
36481
 
36002
36482
 
36003
36483
 
36484
+
36004
36485
  /**
36005
36486
  * Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
36006
36487
  * in backend of you system
@@ -36059,13 +36540,66 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
36059
36540
  const toggleEditable = ()=>{
36060
36541
  (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
36542
  };
36543
+ // The start of the whitespace run that ends at `to`
36544
+ const skipBack = (text, to)=>{
36545
+ while(to > 0 && /\s/.test(text.charAt(to - 1))){
36546
+ to -= 1;
36547
+ }
36548
+ return to;
36549
+ };
36550
+ // The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
36551
+ const cleanBodyTag = (tag)=>{
36552
+ tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
36553
+ const skip = (from, chars)=>{
36554
+ while(chars.test(tag.charAt(from))){
36555
+ from += 1;
36556
+ }
36557
+ return from;
36558
+ };
36559
+ let index = tag.indexOf('contenteditable');
36560
+ while(index !== -1){
36561
+ let to = skip(index + 'contenteditable'.length, /["'\s]/);
36562
+ if (tag.charAt(to) === '=') {
36563
+ to = skip(to + 1, /[\s"']/);
36564
+ if (tag.startsWith('true', to)) {
36565
+ to = skip(to + 4, /["']/);
36566
+ let from = index;
36567
+ if (/["']/.test(tag.charAt(from - 1))) {
36568
+ from -= 1;
36569
+ }
36570
+ from = skipBack(tag, from);
36571
+ return tag.slice(0, from) + tag.slice(to);
36572
+ }
36573
+ }
36574
+ index = tag.indexOf('contenteditable', index + 1);
36575
+ }
36576
+ return tag;
36577
+ };
36062
36578
  const clearMarkers = (html)=>{
36063
36579
  // 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');
36580
+ html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(html, '<style', '>', '</style>', 'jodit-box');
36581
+ const bodyStart = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag)(html, 'body');
36582
+ let bodyEnd = -1;
36583
+ 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)){
36584
+ bodyEnd = index;
36585
+ }
36586
+ if (bodyStart !== -1 && bodyEnd !== -1) {
36587
+ const afterBody = bodyEnd + '</body>'.length;
36588
+ const gt = html.indexOf('>', bodyStart);
36589
+ let body = html.slice(bodyStart, afterBody);
36590
+ if (gt !== -1 && gt < bodyEnd) {
36591
+ body = cleanBodyTag(html.slice(bodyStart, gt)) + html.slice(gt, afterBody);
36592
+ }
36593
+ for (const tag of [
36594
+ 'style',
36595
+ 'script',
36596
+ 'span'
36597
+ ]){
36598
+ body = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
36599
+ }
36600
+ // remove markers: the spans outside the body are the editor's own
36601
+ 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;');
36602
+ 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
36603
  }
36070
36604
  return html;
36071
36605
  };
@@ -41932,9 +42466,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
41932
42466
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
41933
42467
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
41934
42468
  /* 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);
42469
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
42470
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
42471
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
42472
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
41938
42473
  /*!
41939
42474
  * Jodit Editor (https://xdsoft.net/jodit/)
41940
42475
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -41949,16 +42484,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
41949
42484
 
41950
42485
 
41951
42486
 
42487
+
41952
42488
  /**
41953
42489
  * Process `video` and `audio`
41954
42490
  */ function media(editor) {
41955
42491
  const keyFake = 'jodit_fake_wrapper';
41956
42492
  const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
41957
42493
  const wrap = (element)=>{
41958
- if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
42494
+ if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
41959
42495
  element = element.parentNode;
41960
42496
  } 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);
42497
+ 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
42498
  } else if (mediaInFakeBlock) {
41963
42499
  const media = element;
41964
42500
  const wrapper = editor.createInside.element(mediaFakeTag, {
@@ -41967,13 +42503,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
41967
42503
  draggable: true,
41968
42504
  [`data-${keyFake}`]: 1
41969
42505
  });
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'));
42506
+ (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
42507
  // The wrapper fits the media, whose size changes as its metadata loads
41972
42508
  // and as it's resized. A percentage width is of the line, so it takes that
41973
42509
  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',
42510
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
42511
+ display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
42512
+ width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
41977
42513
  height: ''
41978
42514
  });
41979
42515
  };
@@ -42010,15 +42546,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
42010
42546
  }
42011
42547
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
42012
42548
  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
- }
42549
+ data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.unwrapMarkedTags)(data.value, mediaFakeTag, `data-${keyFake}`);
42017
42550
  }).on('change afterInit afterSetMode changePlace', editor.async.debounce(()=>{
42018
42551
  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);
42552
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
42553
+ if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
42554
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
42022
42555
  wrap(elm);
42023
42556
  }
42024
42557
  });
@@ -42999,7 +43532,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
42999
43532
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
43000
43533
  /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
43001
43534
  /* 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);
43535
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
43536
+ /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
43003
43537
  /*!
43004
43538
  * Jodit Editor (https://xdsoft.net/jodit/)
43005
43539
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43011,11 +43545,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43011
43545
 
43012
43546
 
43013
43547
 
43548
+
43014
43549
  /**
43015
43550
  * Remove special HTML comments
43016
43551
  * @private
43017
43552
  */ function removeExtraFragments(html) {
43018
- html = html.replace(/<meta[^>]+?>/g, '');
43553
+ html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix)(html, [
43554
+ '<meta'
43555
+ ]);
43019
43556
  const start = html.search(/<!--StartFragment-->/i);
43020
43557
  if (start !== -1) {
43021
43558
  html = html.substring(start + 20);
@@ -43033,7 +43570,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43033
43570
  * paste bold
43034
43571
  * @private
43035
43572
  */ function removeGoogleDocsWrapper(html) {
43036
- if (!/<b\s[^>]*docs-internal-guid-/i.test(html)) {
43573
+ // A plain search: the wrapper check is left to the parsed document below
43574
+ if (!/docs-internal-guid-/i.test(html)) {
43037
43575
  return html;
43038
43576
  }
43039
43577
  // An inert document: images don't load and handlers don't run
@@ -43088,7 +43626,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43088
43626
  return;
43089
43627
  }
43090
43628
  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, {
43629
+ const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
43092
43630
  text,
43093
43631
  name: text.toLowerCase(),
43094
43632
  tabIndex: 0
@@ -43104,7 +43642,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
43104
43642
  }
43105
43643
  jodit.e.fire('afterClosePasteDialog', dialog);
43106
43644
  });
43107
- const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
43645
+ const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
43108
43646
  text: 'Cancel',
43109
43647
  tabIndex: 0
43110
43648
  }).onAction(()=>{
@@ -44612,12 +45150,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
44612
45150
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
44613
45151
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
44614
45152
  /* 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);
45153
+ /* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
45154
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
45155
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
45156
+ /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42259);
45157
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
45158
+ /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(56490);
45159
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(96608);
44621
45160
  /*!
44622
45161
  * Jodit Editor (https://xdsoft.net/jodit/)
44623
45162
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -44641,6 +45180,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
44641
45180
 
44642
45181
 
44643
45182
 
45183
+
44644
45184
  const keyBInd = '__jodit-resizer_binded';
44645
45185
  /**
44646
45186
  * Reads a plain pixel value out of a `width`/`height` attribute.
@@ -44657,7 +45197,7 @@ const keyBInd = '__jodit-resizer_binded';
44657
45197
  * A video with no height of its own takes it from its width and its ratio,
44658
45198
  * so resizing it keeps the ratio without setting a height.
44659
45199
  */ 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');
45200
+ 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
45201
  }
44662
45202
  const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44663
45203
  /**
@@ -44667,7 +45207,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44667
45207
  */ 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
45208
  /**
44669
45209
  * 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 {
45210
+ */ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
44671
45211
  /** @override */ afterInit(editor) {
44672
45212
  // It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
44673
45213
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
@@ -44684,10 +45224,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44684
45224
  .on('keydown', this.onEditorKeyDown, {
44685
45225
  top: true
44686
45226
  }).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
- }
45227
+ 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
45228
  });
44692
45229
  this.addEventListeners();
44693
45230
  this.__onChangeEditor();
@@ -44723,7 +45260,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44723
45260
  return;
44724
45261
  }
44725
45262
  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')) {
45263
+ if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(image, 'width')) {
44727
45264
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
44728
45265
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width', null);
44729
45266
  }
@@ -44847,7 +45384,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44847
45384
  __followCaret() {
44848
45385
  const before = this.__keyDownRange;
44849
45386
  this.__keyDownRange = null;
44850
- if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__.isMoved)(this.j, before)) {
45387
+ if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__.isMoved)(this.j, before)) {
44851
45388
  return;
44852
45389
  }
44853
45390
  if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
@@ -44882,7 +45419,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44882
45419
  if (!this.isResizeMode) {
44883
45420
  // A click in the element's popup, or in a list it opens, works on
44884
45421
  // 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)) {
45422
+ if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__.Popup)) {
44886
45423
  return;
44887
45424
  }
44888
45425
  return this.hide();
@@ -44906,7 +45443,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44906
45443
  if (changeAttrs) {
44907
45444
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
44908
45445
  }
44909
- if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, key)) {
45446
+ if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, key)) {
44910
45447
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
44911
45448
  }
44912
45449
  }
@@ -44971,7 +45508,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
44971
45508
  const width = element.offsetWidth || attrPixelSize(element, 'width');
44972
45509
  const height = element.offsetHeight || attrPixelSize(element, 'height');
44973
45510
  (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'
45511
+ display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
44975
45512
  });
44976
45513
  if (width) {
44977
45514
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
@@ -45089,7 +45626,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
45089
45626
  }
45090
45627
  if (this.element && this.rect) {
45091
45628
  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;
45629
+ 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
45630
  const newTop = pos.top - workplacePosition.top, newLeft = pos.left - workplacePosition.left;
45094
45631
  if (top !== newTop || left !== newLeft || w !== this.element.offsetWidth || h !== this.element.offsetHeight) {
45095
45632
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, {