jodit-pro-react 5.6.14 → 5.6.15

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-VDRUEIP3.mjs";
3
+ } from "./chunk-WUAETI7F.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.15.4";
196
+ APP_VERSION = "4.15.5";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -21813,6 +21813,7 @@ Config.prototype.cleanHTML = {
21813
21813
  removeEmptyElements: true,
21814
21814
  fillEmptyParagraph: true,
21815
21815
  collapseEmptyValueToEmptyString: false,
21816
+ singleQuotesInFontFamily: true,
21816
21817
  replaceNBSP: true,
21817
21818
  replaceOldTags: {
21818
21819
  i: "em",
@@ -22375,6 +22376,7 @@ var cleanHtml = class extends Plugin {
22375
22376
  * opt-in via `cleanHTML.collapseEmptyValueToEmptyString`. See #1149
22376
22377
  */
22377
22378
  onAfterGetValueFromEditor(data) {
22379
+ this.__singleQuotesInFontFamily(data);
22378
22380
  if (!this.j.o.cleanHTML.collapseEmptyValueToEmptyString) {
22379
22381
  return;
22380
22382
  }
@@ -22382,6 +22384,31 @@ var cleanHtml = class extends Plugin {
22382
22384
  data.value = "";
22383
22385
  }
22384
22386
  }
22387
+ /**
22388
+ * Rewrite double-quoted font names inside `style` attributes with single
22389
+ * quotes. The DOM always serialises them as `"…"`, and back ends
22390
+ * that HTML-decode the value before storing it then produce
22391
+ * `style="font-family: "Open Sans", …"` — broken markup. Single quotes
22392
+ * survive that round trip. Names that already contain an apostrophe are
22393
+ * left alone.
22394
+ */
22395
+ __singleQuotesInFontFamily(data) {
22396
+ if (!this.j.o.cleanHTML.singleQuotesInFontFamily || !data.value.includes(""")) {
22397
+ return;
22398
+ }
22399
+ data.value = data.value.replace(/\sstyle="([^"]*)"/gi, (attribute, css2) => {
22400
+ if (!css2.includes(""") || !/font-family/i.test(css2)) {
22401
+ return attribute;
22402
+ }
22403
+ const normalized = css2.replace(
22404
+ // `"` itself ends with `;`, so the entity has to be
22405
+ // consumed as a unit or the declaration stops inside it.
22406
+ /font-family\s*:(?:"|[^;])*/gi,
22407
+ (declaration) => declaration.includes("'") ? declaration : declaration.replace(/"/g, "'")
22408
+ );
22409
+ return attribute.replace(css2, normalized);
22410
+ });
22411
+ }
22385
22412
  onSafeHTML(sandBox) {
22386
22413
  const sanitizer = this.j.o.cleanHTML.sanitizer;
22387
22414
  if (sanitizer) {
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-VDRUEIP3.mjs";
5
+ } from "./chunk-WUAETI7F.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;