@youngonesworks/ui 0.1.120 → 0.1.121

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.cjs CHANGED
@@ -3530,7 +3530,12 @@ const WysiwygEditor = (0, react.forwardRef)(({ id, content, className, placehold
3530
3530
  immediatelyRender: false,
3531
3531
  editable: !readOnly,
3532
3532
  onUpdate({ editor: editor$1 }) {
3533
- onChange && onChange(editor$1.getHTML().replaceAll(/<li><p>(.*?)<\/p><(\/?)(ol|li|ul)>/gi, "<li>$1<$2$3>").replaceAll("<p></p>", ""));
3533
+ let sanitizedOutput = editor$1.getHTML().replaceAll(/<li><p>(.*?)<\/p><(\/?)(ol|li|ul)>/gi, "<li>$1<$2$3>");
3534
+ sanitizedOutput = sanitizedOutput.replace(/(<p><\/p>\s*)+/gi, "<p></p>");
3535
+ sanitizedOutput = sanitizedOutput.replace(/^(<p><\/p>\s*)+/gi, "");
3536
+ sanitizedOutput = sanitizedOutput.replace(/(<p><\/p>\s*)+$/gi, "");
3537
+ sanitizedOutput = sanitizedOutput.replace(/<p><\/p>/gi, "<br>");
3538
+ onChange && onChange(sanitizedOutput);
3534
3539
  }
3535
3540
  });
3536
3541
  (0, react.useEffect)(() => {