fix: add new styling for emoji links (#14481)

This commit is contained in:
Carina Wollendorfer authored and GitHub committed 2024-04-17 12:30:14 +00:00
1 parent 4aeb6b7c9b
commit 8bb5200dd8
6 files changed
+57 -25

No files matched your search

@@ -376,7 +376,12 @@ export default function ToolbarPlugin(props: TextEditorProps) {
editor.registerUpdateListener(({ editorState, prevEditorState }) => {
editorState.read(() => {
const textInHtml = $generateHtmlFromNodes(editor).replace(/&lt;/g, "<").replace(/&gt;/g, ">");
props.setText(textInHtml);
props.setText(
textInHtml.replace(
/<p\s+class="editor-paragraph"[^>]*>\s*<br>\s*<\/p>/g,
"<p class='editor-paragraph'></p>"
)
);
});
if (!prevEditorState._selection) editor.blur();
});