Skip to content

fix(core): preserve soft line breaks and empty list items#84

Draft
ocavue wants to merge 2 commits into
masterfrom
fix/soft-line-break-hardbreak
Draft

fix(core): preserve soft line breaks and empty list items#84
ocavue wants to merge 2 commits into
masterfrom
fix/soft-line-break-hardbreak

Conversation

@ocavue

@ocavue ocavue commented Jun 19, 2026

Copy link
Copy Markdown
Member

A Markdown soft line break (a single newline inside a paragraph) was stored as a raw \n in a text node, which ProseMirror collapses to a space the moment it re-reads the textblock (any list in the document triggers this on the first paint), silently merging the lines in both the view and the saved file. Soft breaks now parse to a hardBreak node (<br>) that round-trips losslessly. Separately, an empty list item (- ) was dropped entirely on serialize because its marker was never flushed; it now keeps its marker.

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meowdown Ready Ready Preview, Comment Jun 19, 2026 6:40am

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 94.84% 1601 / 1688
🔵 Statements 92.65% 1779 / 1920
🔵 Functions 93.41% 383 / 410
🔵 Branches 85.42% 944 / 1105
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/converters/md-to-pm.ts 96.02% 73.19% 100% 96.5% 44, 65-69, 73, 121
packages/core/src/converters/pm-to-md.ts 94.59% 85.29% 100% 96.75% 64, 176-177, 189-190, 209, 328, 345, 384
packages/core/src/extensions/extension.ts 100% 100% 100% 100%
packages/core/src/extensions/node-names.ts 100% 100% 100% 100%
Generated in workflow #333 for commit a354dcb by the Vitest Coverage Report Action

@pkg-pr-new

pkg-pr-new Bot commented Jun 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/prosekit/meowdown/@meowdown/core@84
npm i https://pkg.pr.new/prosekit/meowdown/@meowdown/react@84

commit: a354dcb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant