jodit-pro-react 5.5.45 → 5.5.47

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JoditEditor_default
3
- } from "./chunk-SWNAIHGO.mjs";
3
+ } from "./chunk-LZKMP6NI.mjs";
4
4
  export {
5
5
  JoditEditor_default as default
6
6
  };
@@ -193,7 +193,7 @@ var APP_VERSION, ES, IS_ES_MODERN, IS_ES_NEXT, IS_PROD, IS_TEST, FAT_MODE, HOMEP
193
193
  var init_constants = __esm({
194
194
  "node_modules/jodit/esm/core/constants.js"() {
195
195
  "use strict";
196
- APP_VERSION = "4.12.29";
196
+ APP_VERSION = "4.12.31";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -3310,11 +3310,15 @@ function normalizeCSS(s49) {
3310
3310
  });
3311
3311
  }
3312
3312
  function applyStyles(html) {
3313
- if (html.indexOf("<html ") === -1) {
3313
+ const openMatch = /<html(?:\s[^>]*)?>/i.exec(html);
3314
+ if (!openMatch) {
3314
3315
  return html;
3315
3316
  }
3316
- html = html.substring(html.indexOf("<html "), html.length);
3317
- html = html.substring(0, html.lastIndexOf("</html>") + "</html>".length);
3317
+ html = html.substring(openMatch.index);
3318
+ const closeIndex = html.toLowerCase().lastIndexOf("</html>");
3319
+ if (closeIndex !== -1) {
3320
+ html = html.substring(0, closeIndex + "</html>".length);
3321
+ }
3318
3322
  const iframe2 = globalDocument.createElement("iframe");
3319
3323
  iframe2.style.display = "none";
3320
3324
  globalDocument.body.appendChild(iframe2);
@@ -4473,8 +4477,9 @@ function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError } = {
4473
4477
  attr(elm, "onerror", null);
4474
4478
  effected = true;
4475
4479
  }
4480
+ const tagName = elm.nodeName.toLowerCase();
4476
4481
  const href = elm.getAttribute("href");
4477
- if (safeJavaScriptLink && href && href.trim().indexOf("javascript") === 0) {
4482
+ if (safeJavaScriptLink && href && isDangerousUrl(href, tagName)) {
4478
4483
  attr(elm, "href", location.protocol + "//" + href);
4479
4484
  effected = true;
4480
4485
  }
@@ -4483,7 +4488,6 @@ function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError } = {
4483
4488
  attr(elm, "srcdoc", null);
4484
4489
  effected = true;
4485
4490
  }
4486
- const tagName = elm.nodeName.toLowerCase();
4487
4491
  for (const name of URL_ATTRIBUTES) {
4488
4492
  const value = elm.getAttribute(name);
4489
4493
  if (value && isDangerousUrl(value, tagName)) {
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-SWNAIHGO.mjs";
5
+ } from "./chunk-LZKMP6NI.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;