Skip to content

fix(muya): keep the rest of a blockquote quoted on forward-Delete merge (#5423) - #5424

Merged
Jocs merged 3 commits into
developfrom
fix/5423-delete-merge-blockquote
Sep 16, 2026
Merged

Jocs merged 3 commits into
developfrom
fix/5423-delete-merge-blockquote

Conversation

@Jocs

@Jocs Jocs commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #5423

Summary

Forward Delete at the end of a paragraph that is followed by a blockquote merged the quote's first paragraph, as expected, but also moved the quote's remaining paragraphs out of it, so the quote disappeared. They now stay quoted, as in 0.19.1:

Document, Delete at the end of a develop / 0.20.0-rc.3 this PR / 0.19.1
a · > p · > q ap · q ap · > q
- a with > p · > q inside the item - ap · q - ap · > q

Cause

Format.deleteHandler merges the next paragraph into the current block. #4725 (#1845) made it first move the blocks that follow that paragraph next to the current block whenever the two paragraphs are in different containers. That is meant for list items: the next item's nested sublist has to travel up with its text, otherwise it is left as the item's only child and serializes with a doubled bullet. The check did not require a list item, so a blockquote's later paragraphs were moved out as well.

Fix

Take the move only when the next paragraph's container is a list-item or a task-list-item. For any other container the only-child walk removes just the merged paragraph, as before #4725.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added
    • Unit (deleteMerge.spec.ts, real engine): the two documents above give ap\n\n> q\n and - ap\n\n > q\n. Both fail without the fix (q unquoted). A task list guard for Deleting an item creates double itemization bullets in front of the next item #1845 (- [ ] a / - [ ] C + - D, first item emptied) keeps - [ ] C\n - D\n; it fails with a doubled bullet if task-list-item is dropped from the check.
    • E2E (editing/delete-merge-blockquote-5423.spec.ts, Chromium, real click, End, Delete, then typing Z): aZp\n\n> q\n and - aZp\n\n > q\n, no page errors. Both fail without the fix.
  • Packaged apps driven with Playwright (click at the end of a, Delete, type Z): 0.19.1 gives aZp / > q, 0.20.0-rc.3 gives aZp / q.
  • packages/muya: all unit tests pass (1813), tsc --noEmit and check-circular pass; ESLint reports no errors on the changed files.
  • Muya e2e in Chromium: the new spec plus cross-block-enter, paragraph-menu-in-table-or-code-4944 and cut-rest-of-container-5385 (7 passed).

Notes for reviewers

🤖 Generated with Claude Code

Jocs and others added 2 commits September 16, 2026 21:58
…ge (#5423)

Delete at the end of a paragraph merges the next paragraph into it. #4725
(fixing #1845) made that merge move every block after the next paragraph
out of its container whenever the two paragraphs sat in different
containers, so a nested sublist travels up with its list item's text. The
check did not require the container to be a list item, so merging a
blockquote's first paragraph also moved the quote's remaining paragraphs
out of it and the quote disappeared.

Only move the trailing blocks when the next paragraph's container is a
list item or a task list item. List items and task list items still carry
their trailing blocks along; a blockquote keeps its later paragraphs.

Fixes #5423

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@Jocs
Jocs force-pushed the fix/5423-delete-merge-blockquote branch from 2bbc6f6 to 5bd845d Compare September 16, 2026 14:02
@Jocs
Jocs merged commit 73b90a7 into develop Sep 16, 2026
7 checks passed
@Jocs
Jocs deleted the fix/5423-delete-merge-blockquote branch September 16, 2026 15:02
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.

[Bug] Forward Delete at the end of a paragraph pulls the rest of the following blockquote out of the quote

1 participant