From e5b365b16f284b96a3b9473e41538930ad6a6532 Mon Sep 17 00:00:00 2001 From: amandesai01 Date: Wed, 4 Dec 2024 13:37:05 +0000 Subject: [PATCH] fix(rich-text): map `\n` to `
` --- packages/nc-gui/components/cell/RichText.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/cell/RichText.vue b/packages/nc-gui/components/cell/RichText.vue index 2c1f7d449b..a01b7e41d6 100644 --- a/packages/nc-gui/components/cell/RichText.vue +++ b/packages/nc-gui/components/cell/RichText.vue @@ -280,12 +280,12 @@ const editor = useEditor({ }, }) -const setEditorContent = (contentMd: any, focusEndOfDoc?: boolean) => { +const setEditorContent = (contentMd: string, focusEndOfDoc?: boolean) => { if (!editor.value) return const selection = editor.value.view.state.selection - const contentHtml = contentMd ? marked.parse(contentMd) : '

' + const contentHtml = contentMd ? marked.parse(contentMd.replaceAll('\n', '
')) : '

' const content = generateJSON(contentHtml, tiptapExtensions)