Browse Source

Merge pull request #9960 from nocodb/nc-fix/rich-text-new-line

fix(rich-text): map `\n` to `<br/>`
pull/9971/head
Raju Udava 1 week ago committed by GitHub
parent
commit
15e77c473b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/nc-gui/components/cell/RichText.vue

4
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 if (!editor.value) return
const selection = editor.value.view.state.selection const selection = editor.value.view.state.selection
const contentHtml = contentMd ? marked.parse(contentMd) : '<p></p>' const contentHtml = contentMd ? marked.parse(contentMd.replaceAll('\n', '<br/>')) : '<p></p>'
const content = generateJSON(contentHtml, tiptapExtensions) const content = generateJSON(contentHtml, tiptapExtensions)

Loading…
Cancel
Save