@youngonesworks/ui 0.1.119 → 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 +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3508,7 +3508,12 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
|
|
|
3508
3508
|
immediatelyRender: false,
|
|
3509
3509
|
editable: !readOnly,
|
|
3510
3510
|
onUpdate({ editor: editor$1 }) {
|
|
3511
|
-
|
|
3511
|
+
let sanitizedOutput = editor$1.getHTML().replaceAll(/<li><p>(.*?)<\/p><(\/?)(ol|li|ul)>/gi, "<li>$1<$2$3>");
|
|
3512
|
+
sanitizedOutput = sanitizedOutput.replace(/(<p><\/p>\s*)+/gi, "<p></p>");
|
|
3513
|
+
sanitizedOutput = sanitizedOutput.replace(/^(<p><\/p>\s*)+/gi, "");
|
|
3514
|
+
sanitizedOutput = sanitizedOutput.replace(/(<p><\/p>\s*)+$/gi, "");
|
|
3515
|
+
sanitizedOutput = sanitizedOutput.replace(/<p><\/p>/gi, "<br>");
|
|
3516
|
+
onChange && onChange(sanitizedOutput);
|
|
3512
3517
|
}
|
|
3513
3518
|
});
|
|
3514
3519
|
useEffect(() => {
|