@enyxs/wikex-components 0.11.25 → 0.11.26

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.
package/dist/index.mjs CHANGED
@@ -363,6 +363,7 @@ function parseCmsRichText(value4) {
363
363
  if (typeof mark.italic === "boolean") next.italic = mark.italic;
364
364
  if (typeof mark.underline === "boolean") next.underline = mark.underline;
365
365
  if (typeof mark.href === "string") next.href = safeCmsTextHref(mark.href);
366
+ if (next.href && typeof mark.newTab === "boolean") next.newTab = mark.newTab;
366
367
  if (next.bold !== void 0 || next.italic !== void 0 || next.underline !== void 0 || next.href) marks.push(next);
367
368
  }
368
369
  return { text: raw.text, marks };
@@ -400,6 +401,7 @@ function patchCmsRichText(value4, text2, start, end, patch) {
400
401
  rich.marks.filter((m) => m.start <= a && m.end >= b).forEach((m) => Object.assign(style, m));
401
402
  if (a >= start && b <= end) Object.assign(style, patch);
402
403
  const next = { start: a, end: b, bold: style.bold, italic: style.italic, underline: style.underline, newTab: style.newTab, href: style.href ? safeCmsTextHref(style.href) : void 0 };
404
+ if (!next.href) delete next.newTab;
403
405
  if (next.bold === void 0 && next.italic === void 0 && next.underline === void 0 && !next.href) continue;
404
406
  const previous = marks[marks.length - 1];
405
407
  if (previous && previous.end === a && previous.bold === next.bold && previous.italic === next.italic && previous.underline === next.underline && previous.href === next.href && previous.newTab === next.newTab) previous.end = b;