diff --git a/packages/client/src/components/document/export/index.tsx b/packages/client/src/components/document/export/index.tsx index 4c4b9b1..a9e07b5 100644 --- a/packages/client/src/components/document/export/index.tsx +++ b/packages/client/src/components/document/export/index.tsx @@ -136,7 +136,6 @@ export const DocumentExporter: React.FC = ({ document, render }) => { ); useEffect(() => { - console.log('doc', editor, document); const c = safeJSONParse(document && document.content); const json = c.default || c; editor.commands.setContent(json); diff --git a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/index.ts b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/index.ts index 2a1e878..58df9d7 100644 --- a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/index.ts +++ b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/index.ts @@ -37,6 +37,10 @@ function fixNode(doc) { }; } }); + + if (!node.content || !node.content.length) { + node.content = [{ attrs: {}, type: 'paragraph' }]; + } } if (node.content) {