Skip to content

fix(HardBreak): render DOM linebreak as soft breaks#8798

Draft
mejo- wants to merge 1 commit into
mainfrom
fix/bullet_list_hard_break
Draft

fix(HardBreak): render DOM linebreak as soft breaks#8798
mejo- wants to merge 1 commit into
mainfrom
fix/bullet_list_hard_break

Conversation

@mejo-

@mejo- mejo- commented Jul 1, 2026

Copy link
Copy Markdown
Member

Fixes: #8775

prosemirror-model 1.25.4 now conversts newlines into the schema's linebreakReplacement (our HardBreak), producing spurious <br> in nested bullet lists as we use preserveWhitspace: true there..

The commit fixes this by distinguishing HardBreaks: when created as linebreakReplacement, they become type 'soft', otherwise the old behaviour is retained.

The added tests are not regression tests for #8775. They ensure that multi-line list items are preserved in Markdown (which they would not with preserveWhitespace: false in BulletList).

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

🤖 AI (if applicable)

  • The content of this PR was partly generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Fixes: #8775

prosemirror-model 1.25.4 now conversts newlines into the schema's
linebreakReplacement (our HardBreak), producing spurious `<br>` in
nested bullet lists as we use `preserveWhitspace: true` there..

The commit fixes this by distinguishing HardBreaks: when created as
linebreakReplacement, they become type 'soft', otherwise the old
behaviour is retained.

The added tests are not regression tests for #8775. They ensure that
multi-line list items are preserved in Markdown (which they would not
with `preserveWhitespace: false` in BulletList).

Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- self-assigned this Jul 1, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🧭 Planning evaluation (don't pick)

Development

Successfully merging this pull request may close these issues.

Hardbreak added in a markdown list item that is followed by a nested list item

1 participant