diff --git a/src/components/Editor/TipTapWrapper.tsx b/src/components/Editor/TipTapWrapper.tsx index faec5cf..a8aff4d 100644 --- a/src/components/Editor/TipTapWrapper.tsx +++ b/src/components/Editor/TipTapWrapper.tsx @@ -156,14 +156,13 @@ const TipTapWrapper: React.FC = ({ }); break; case "p": - if (content && content.trim().length > 0) { - blocks.push({ - id: `block-${blockId++}`, - type: "text", - content, - htmlContent, - }); - } + // Always preserve paragraph blocks, even if empty (for proper newline handling) + blocks.push({ + id: `block-${blockId++}`, + type: "text", + content: content || "", + htmlContent, + }); break; default: // For other elements, only process if they have meaningful content diff --git a/src/index.css b/src/index.css index 5370420..cfb7cea 100644 --- a/src/index.css +++ b/src/index.css @@ -212,11 +212,18 @@ .ProseMirror p { overflow-wrap: break-word; min-height: 1em; + margin: 0; + padding: 0; + } + + .ProseMirror p:empty { + min-height: 1em; } .ProseMirror p:empty::before { content: '\200B'; - display: inline; + display: inline-block; + width: 0; } .ProseMirror p.is-editor-empty:first-child::before {