jodit 4.14.4 → 4.14.6

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 (187) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +9 -9
  4. package/es2015/jodit.js +49 -34
  5. package/es2015/jodit.min.js +9 -9
  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 +9 -9
  13. package/es2018/jodit.min.js +9 -9
  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 +10 -10
  18. package/es2021/jodit.js +49 -34
  19. package/es2021/jodit.min.js +10 -10
  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 +10 -10
  28. package/es2021.en/jodit.js +49 -34
  29. package/es2021.en/jodit.min.js +10 -10
  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 +49 -34
  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/global.js +1 -1
  53. package/esm/core/helpers/checker/has-browser-color-picker.js +1 -1
  54. package/esm/core/helpers/html/apply-styles.js +1 -1
  55. package/esm/core/helpers/string/fuzzy-search-index.js +1 -1
  56. package/esm/core/helpers/utils/set.js +2 -2
  57. package/esm/core/storage/async-storage.js +1 -3
  58. package/esm/core/ui/popup/popup.js +1 -1
  59. package/esm/modules/image-editor/image-editor.js +1 -1
  60. package/esm/modules/table/table.js +2 -2
  61. package/esm/modules/widget/file-selector/file-selector.js +0 -1
  62. package/esm/plugins/ai-assistant/langs/en.js +1 -1
  63. package/esm/plugins/ai-assistant/langs/es.js +1 -1
  64. package/esm/plugins/backspace/cases/check-remove-char.js +0 -1
  65. package/esm/plugins/clean-html/helpers/visitor/filters/replace-old-tags.js +0 -1
  66. package/esm/plugins/color/config.js +1 -1
  67. package/esm/plugins/copy-format/langs/ar.js +1 -1
  68. package/esm/plugins/copy-format/langs/cs_cz.js +1 -1
  69. package/esm/plugins/copy-format/langs/de.js +1 -1
  70. package/esm/plugins/copy-format/langs/es.js +1 -1
  71. package/esm/plugins/copy-format/langs/fa.js +1 -1
  72. package/esm/plugins/copy-format/langs/fi.js +1 -1
  73. package/esm/plugins/copy-format/langs/fr.js +1 -1
  74. package/esm/plugins/copy-format/langs/he.js +1 -1
  75. package/esm/plugins/copy-format/langs/hu.js +1 -1
  76. package/esm/plugins/copy-format/langs/id.js +1 -1
  77. package/esm/plugins/copy-format/langs/it.js +1 -1
  78. package/esm/plugins/copy-format/langs/ja.js +1 -1
  79. package/esm/plugins/copy-format/langs/ko.js +1 -1
  80. package/esm/plugins/copy-format/langs/mn.js +1 -1
  81. package/esm/plugins/copy-format/langs/nl.js +1 -1
  82. package/esm/plugins/copy-format/langs/pl.js +1 -1
  83. package/esm/plugins/copy-format/langs/pt_br.js +1 -1
  84. package/esm/plugins/copy-format/langs/ru.js +1 -1
  85. package/esm/plugins/copy-format/langs/tr.js +1 -1
  86. package/esm/plugins/copy-format/langs/zh_cn.js +1 -1
  87. package/esm/plugins/copy-format/langs/zh_tw.js +1 -1
  88. package/esm/plugins/iframe/iframe.js +28 -9
  89. package/esm/plugins/line-height/langs/ar.js +1 -1
  90. package/esm/plugins/line-height/langs/cs_cz.js +1 -1
  91. package/esm/plugins/line-height/langs/de.js +1 -1
  92. package/esm/plugins/line-height/langs/es.js +1 -1
  93. package/esm/plugins/line-height/langs/fa.js +1 -1
  94. package/esm/plugins/line-height/langs/fi.js +1 -1
  95. package/esm/plugins/line-height/langs/fr.js +1 -1
  96. package/esm/plugins/line-height/langs/he.js +1 -1
  97. package/esm/plugins/line-height/langs/hu.js +1 -1
  98. package/esm/plugins/line-height/langs/id.js +1 -1
  99. package/esm/plugins/line-height/langs/it.js +1 -1
  100. package/esm/plugins/line-height/langs/ja.js +1 -1
  101. package/esm/plugins/line-height/langs/ko.js +1 -1
  102. package/esm/plugins/line-height/langs/mn.js +1 -1
  103. package/esm/plugins/line-height/langs/nl.js +1 -1
  104. package/esm/plugins/line-height/langs/pl.js +1 -1
  105. package/esm/plugins/line-height/langs/pt_br.js +1 -1
  106. package/esm/plugins/line-height/langs/ru.js +1 -1
  107. package/esm/plugins/line-height/langs/sk.js +1 -1
  108. package/esm/plugins/line-height/langs/tr.js +1 -1
  109. package/esm/plugins/line-height/langs/ua.js +1 -1
  110. package/esm/plugins/line-height/langs/zh_cn.js +1 -1
  111. package/esm/plugins/line-height/langs/zh_tw.js +1 -1
  112. package/esm/plugins/resize-cells/resize-cells.js +2 -2
  113. package/esm/plugins/resizer/resizer.js +1 -1
  114. package/esm/plugins/search/helpers/sentence-finder.js +1 -1
  115. package/esm/plugins/source/source.js +1 -1
  116. package/esm/plugins/speech-recognize/langs/ar.js +1 -1
  117. package/esm/plugins/speech-recognize/langs/cs_cz.js +1 -1
  118. package/esm/plugins/speech-recognize/langs/de.js +1 -1
  119. package/esm/plugins/speech-recognize/langs/es.js +1 -1
  120. package/esm/plugins/speech-recognize/langs/fa.js +1 -1
  121. package/esm/plugins/speech-recognize/langs/fi.js +1 -1
  122. package/esm/plugins/speech-recognize/langs/fr.js +1 -1
  123. package/esm/plugins/speech-recognize/langs/he.js +1 -1
  124. package/esm/plugins/speech-recognize/langs/hu.js +1 -1
  125. package/esm/plugins/speech-recognize/langs/id.js +1 -1
  126. package/esm/plugins/speech-recognize/langs/it.js +1 -1
  127. package/esm/plugins/speech-recognize/langs/ja.js +1 -1
  128. package/esm/plugins/speech-recognize/langs/ko.js +1 -1
  129. package/esm/plugins/speech-recognize/langs/mn.js +1 -1
  130. package/esm/plugins/speech-recognize/langs/nl.js +1 -1
  131. package/esm/plugins/speech-recognize/langs/no.js +1 -1
  132. package/esm/plugins/speech-recognize/langs/pl.js +1 -1
  133. package/esm/plugins/speech-recognize/langs/pt_br.js +1 -1
  134. package/esm/plugins/speech-recognize/langs/ru.js +1 -1
  135. package/esm/plugins/speech-recognize/langs/sk.js +1 -1
  136. package/esm/plugins/speech-recognize/langs/tr.js +1 -1
  137. package/esm/plugins/speech-recognize/langs/ua.js +1 -1
  138. package/esm/plugins/speech-recognize/langs/zh_cn.js +1 -1
  139. package/esm/plugins/speech-recognize/langs/zh_tw.js +1 -1
  140. package/esm/plugins/spellcheck/langs/ar.js +1 -1
  141. package/esm/plugins/spellcheck/langs/cs_cz.js +1 -1
  142. package/esm/plugins/spellcheck/langs/de.js +1 -1
  143. package/esm/plugins/spellcheck/langs/es.js +1 -1
  144. package/esm/plugins/spellcheck/langs/fa.js +1 -1
  145. package/esm/plugins/spellcheck/langs/fi.js +1 -1
  146. package/esm/plugins/spellcheck/langs/fr.js +1 -1
  147. package/esm/plugins/spellcheck/langs/he.js +1 -1
  148. package/esm/plugins/spellcheck/langs/hu.js +1 -1
  149. package/esm/plugins/spellcheck/langs/id.js +1 -1
  150. package/esm/plugins/spellcheck/langs/it.js +1 -1
  151. package/esm/plugins/spellcheck/langs/ja.js +1 -1
  152. package/esm/plugins/spellcheck/langs/ko.js +1 -1
  153. package/esm/plugins/spellcheck/langs/mn.js +1 -1
  154. package/esm/plugins/spellcheck/langs/nl.js +1 -1
  155. package/esm/plugins/spellcheck/langs/no.js +1 -1
  156. package/esm/plugins/spellcheck/langs/pl.js +1 -1
  157. package/esm/plugins/spellcheck/langs/pt_br.js +1 -1
  158. package/esm/plugins/spellcheck/langs/ru.js +1 -1
  159. package/esm/plugins/spellcheck/langs/sk.js +1 -1
  160. package/esm/plugins/spellcheck/langs/tr.js +1 -1
  161. package/esm/plugins/spellcheck/langs/ua.js +1 -1
  162. package/esm/plugins/spellcheck/langs/zh_cn.js +1 -1
  163. package/esm/plugins/spellcheck/langs/zh_tw.js +1 -1
  164. package/esm/plugins/symbols/langs/ar.js +1 -1
  165. package/esm/plugins/symbols/langs/cs_cz.js +1 -1
  166. package/esm/plugins/symbols/langs/de.js +1 -1
  167. package/esm/plugins/symbols/langs/es.js +1 -1
  168. package/esm/plugins/symbols/langs/fa.js +1 -1
  169. package/esm/plugins/symbols/langs/fi.js +1 -1
  170. package/esm/plugins/symbols/langs/fr.js +1 -1
  171. package/esm/plugins/symbols/langs/he.js +1 -1
  172. package/esm/plugins/symbols/langs/hu.js +1 -1
  173. package/esm/plugins/symbols/langs/id.js +1 -1
  174. package/esm/plugins/symbols/langs/it.js +1 -1
  175. package/esm/plugins/symbols/langs/ja.js +1 -1
  176. package/esm/plugins/symbols/langs/ko.js +1 -1
  177. package/esm/plugins/symbols/langs/mn.js +1 -1
  178. package/esm/plugins/symbols/langs/nl.js +1 -1
  179. package/esm/plugins/symbols/langs/pl.js +1 -1
  180. package/esm/plugins/symbols/langs/pt_br.js +1 -1
  181. package/esm/plugins/symbols/langs/ru.js +1 -1
  182. package/esm/plugins/symbols/langs/tr.js +1 -1
  183. package/esm/plugins/symbols/langs/ua.js +1 -1
  184. package/esm/plugins/symbols/langs/zh_cn.js +1 -1
  185. package/esm/plugins/symbols/langs/zh_tw.js +1 -1
  186. package/esm/plugins/table/config.js +1 -1
  187. package/package.json +4 -1
@@ -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.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.14.4";
6
+ export const APP_VERSION = "4.14.6";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -43,7 +43,7 @@ export class Dom {
43
43
  const first = current;
44
44
  let last = current;
45
45
  editor.s.save();
46
- let needFindNext = false;
46
+ let needFindNext;
47
47
  do {
48
48
  needFindNext = false;
49
49
  tmp = last.nextSibling;
@@ -79,7 +79,7 @@ export class Dom {
79
79
  let first = current;
80
80
  let last = current;
81
81
  editor.s.save();
82
- let needFindNext = false;
82
+ let needFindNext;
83
83
  do {
84
84
  needFindNext = false;
85
85
  tmp = first.previousSibling;
@@ -58,7 +58,7 @@ export function getContainer(jodit, classFunc, tag = 'div', createInsideEditor =
58
58
  : 'jodit-utils';
59
59
  const data = boxes.get(jodit) || {}, key = name + tag;
60
60
  const view = isViewObject(jodit) ? jodit : jodit.j;
61
- let body = null;
61
+ let body;
62
62
  if (!data[key]) {
63
63
  let c = view.c;
64
64
  body = getPopupViewRoot(view.o, view.container, jodit.od.body);
@@ -11,7 +11,7 @@ import { globalDocument } from "../../constants.js";
11
11
  * Check if browser has a color picker (a new HTML5 attribute for input tag)
12
12
  */
13
13
  export function hasBrowserColorPicker() {
14
- let supportsColor = true;
14
+ let supportsColor;
15
15
  try {
16
16
  const a = globalDocument.createElement('input');
17
17
  a.type = 'color';
@@ -52,7 +52,7 @@ export function applyStyles(html) {
52
52
  const iframe = globalDocument.createElement('iframe');
53
53
  css(iframe, 'display', 'none');
54
54
  Dom.append(globalDocument.body, iframe);
55
- let convertedString = '', collection = [];
55
+ let convertedString = '', collection;
56
56
  try {
57
57
  const iframeDoc = iframe.contentDocument ||
58
58
  (iframe.contentWindow ? iframe.contentWindow.document : null);
@@ -12,7 +12,7 @@ import { INVISIBLE_SPACE } from "../../constants.js";
12
12
  * Unlike `indexOf` ignores INVISIBLE_SPACE and may fail at `maxDistance` characters
13
13
  */
14
14
  export function fuzzySearchIndex(needle, haystack, offset = 0, maxDistance = 1) {
15
- let i = 0, j = 0, startIndex = -1, len = 0, errorDistance = 0;
15
+ let i = 0, j, startIndex = -1, len = 0, errorDistance = 0;
16
16
  for (j = offset; i < needle.length && j < haystack.length;) {
17
17
  if (needle[i].toLowerCase() === haystack[j].toLowerCase()) {
18
18
  i++;
@@ -29,9 +29,9 @@ export function set(chain, value, obj) {
29
29
  if (parts.some(isUnsafeProtoKey)) {
30
30
  return;
31
31
  }
32
- let result = obj, key = parts[0];
32
+ let result = obj;
33
33
  for (let i = 0; i < parts.length - 1; i += 1) {
34
- key = parts[i];
34
+ const key = parts[i];
35
35
  if (!isArray(result[key]) && !isPlainObject(result[key])) {
36
36
  result[key] = isNumeric(parts[i + 1]) ? [] : {};
37
37
  }
@@ -47,7 +47,6 @@ export class AsyncStorage {
47
47
  }
48
48
  static makeStorage(persistentOrStrategy = false, suffix, options) {
49
49
  let provider = undefined;
50
- let storage = null;
51
50
  // An explicit `defaultProvider` overrides the strategy-based selection
52
51
  // below and decides which provider backs the storage.
53
52
  const defaultProvider = options === null || options === void 0 ? void 0 : options.defaultProvider;
@@ -81,7 +80,6 @@ export class AsyncStorage {
81
80
  if (!provider) {
82
81
  provider = new MemoryStorageProvider();
83
82
  }
84
- storage = new AsyncStorage(Promise.resolve(provider), suffix);
85
- return storage;
83
+ return new AsyncStorage(Promise.resolve(provider), suffix);
86
84
  }
87
85
  }
@@ -206,7 +206,7 @@ export class Popup extends UIGroup {
206
206
  };
207
207
  };
208
208
  const getMatchStrategy = (inBox) => {
209
- let strategy = null;
209
+ let strategy;
210
210
  if (Popup.boxInView(getPointByStrategy(defaultStrategy), inBox)) {
211
211
  strategy = defaultStrategy;
212
212
  }
@@ -301,7 +301,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends ViewComponent {
301
301
  };
302
302
  this.calcCropBox = () => {
303
303
  const node = this.crop_box.parentNode, w = node.offsetWidth * 0.8, h = node.offsetHeight * 0.8;
304
- let wn = w, hn = h;
304
+ let wn, hn;
305
305
  const { naturalWidth: nw, naturalHeight: nh } = this;
306
306
  if (w > nw && h > nh) {
307
307
  wn = nw;
@@ -434,8 +434,8 @@ export class Table extends ViewComponent {
434
434
  }
435
435
  }
436
436
  static __removeExtraRowspans(box, marked) {
437
- let i = 0;
438
- let j = 0;
437
+ let i;
438
+ let j;
439
439
  for (i = 0; i < box.length; i += 1) {
440
440
  let min = 1000000;
441
441
  let not = false;
@@ -82,7 +82,6 @@ export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true
82
82
  }),
83
83
  new UIBlock(editor, [button])
84
84
  ]);
85
- currentImage = null;
86
85
  if (elm &&
87
86
  !Dom.isText(elm) &&
88
87
  !Dom.isComment(elm) &&
@@ -4,7 +4,7 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  aiAssistant: 'AI Assistant',
9
9
  aiCommands: 'AI Commands',
10
10
  'AI Assistant': 'AI Assistant',
@@ -4,7 +4,7 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  aiAssistant: 'Asistente de IA',
9
9
  aiCommands: 'Comandos de IA',
10
10
  'AI Assistant': 'Asistente de IA',
@@ -63,7 +63,6 @@ export function checkRemoveChar(jodit, fakeNode, backspace, mode) {
63
63
  }
64
64
  if (removeNeighbor) {
65
65
  Dom.safeRemove(removeNeighbor);
66
- removeNeighbor = null;
67
66
  }
68
67
  if (charRemoved) {
69
68
  removeEmptyForParent(fakeNode, 'a');
@@ -10,7 +10,6 @@ import { Dom } from "../../../../../core/dom/dom.js";
10
10
  export function replaceOldTags(jodit, nodeElm, hadEffect) {
11
11
  const newNodeElm = replaceIfMatched(jodit, nodeElm, jodit.o.cleanHTML.replaceOldTags);
12
12
  if (nodeElm !== newNodeElm) {
13
- nodeElm = newNodeElm;
14
13
  return true;
15
14
  }
16
15
  return hadEffect;
@@ -79,7 +79,7 @@ Config.prototype.controls.brush = {
79
79
  button.state.activated = false;
80
80
  },
81
81
  popup: (editor, current, close, button) => {
82
- let colorHEX = '', bg_color = '', tabs = [], currentElement = null;
82
+ let colorHEX = '', bg_color = '', tabs, currentElement = null;
83
83
  if (current && current !== editor.editor && Dom.isNode(current)) {
84
84
  if (Dom.isElement(current) &&
85
85
  editor.s.isCollapsed() &&
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'نسخ التنسيق'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Kopírovat formát'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Format kopierenт'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Copiar formato'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'کپی کردن قالب'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Kopioi muotoilu'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Format de copie'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'העתק עיצוב'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Formátum másolás'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'salin format'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Copia il formato'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'copyformat'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': '복사 형식'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Формат хуулах'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'opmaak kopiëren'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'format kopii'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Copiar formato'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Копировать формат'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': 'Kopyalama Biçimi'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': '复制格式'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'copy-format': '複製格式'
9
9
  };
@@ -101,6 +101,26 @@ export function iframe(editor) {
101
101
  }
102
102
  return html;
103
103
  };
104
+ /**
105
+ * Replace the whole iframe document with the given HTML.
106
+ *
107
+ * The markup is parsed in an inert document first (no browsing
108
+ * context: scripts do not run, sub-resources are not fetched),
109
+ * sanitized there via `safeHTML`, and only then moved into the
110
+ * live document. `document.write` on the live document would
111
+ * execute inline scripts and event handlers while parsing,
112
+ * before the sanitizer had a chance to strip them, and the
113
+ * iframe is same-origin with the host page by default.
114
+ * A `<script>` the cleaner is configured to keep still never
115
+ * executes: nodes coming from an inert parser are flagged
116
+ * "already started", exactly like `innerHTML`.
117
+ * See GHSA-w3xv-x3fm-59ph.
118
+ */
119
+ const replaceDocument = (html) => {
120
+ const inert = new DOMParser().parseFromString(html, 'text/html');
121
+ editor.e.fire('safeHTML', inert.documentElement);
122
+ doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
123
+ };
104
124
  if (docMode) {
105
125
  const tag = editor.element.tagName;
106
126
  if (tag !== 'TEXTAREA' && tag !== 'INPUT') {
@@ -117,21 +137,20 @@ export function iframe(editor) {
117
137
  const old = doc.documentElement.outerHTML;
118
138
  if (clearMarkers(old) !==
119
139
  clearMarkers(value)) {
120
- doc.open();
121
- doc.write(editor.o.iframeDoctype +
122
- clearMarkers(value));
123
- doc.close();
140
+ replaceDocument(clearMarkers(value));
124
141
  editor.editor = doc.body;
125
- editor.e.fire('safeHTML', editor.editor);
126
142
  toggleEditable();
127
143
  editor.e.fire('prepareWYSIWYGEditor');
128
144
  editor.e.stopPropagation('beforeSetNativeEditorValue');
129
145
  }
146
+ return true;
130
147
  }
131
- else {
132
- doc.body.innerHTML = value;
133
- }
134
- return true;
148
+ // A partial value goes through the regular
149
+ // path: `clean-html` sanitizes it and the
150
+ // editor assigns it to `doc.body` via
151
+ // `innerHTML`. Writing the raw value here
152
+ // would fire its event handlers first.
153
+ return false;
135
154
  }, { top: true });
136
155
  }
137
156
  editor.editor = doc.body;
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'ارتفاع الخط'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Výška čáry'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Zeilenhöhe'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Altura de la línea'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'ارتفاع خط'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Rivin korkeus'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Hauteur de ligne'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'גובה שורה'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Vonal magassága'
9
9
  };
@@ -4,6 +4,6 @@
4
4
  * Released under MIT see LICENSE.txt in the project root for license information.
5
5
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6
6
  */
7
- export default {
7
+ module.exports = {
8
8
  'Line height': 'Tinggi baris'
9
9
  };