Repository navigation
fix(muya): keep the rest of a blockquote quoted on forward-Delete merge (#5423) - #5424
Merged
Merged
Conversation
…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]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Jocs
force-pushed
the
fix/5423-delete-merge-blockquote
branch
from
September 16, 2026 14:02
2bbc6f6 to
5bd845d
Compare
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
aa·> p·> qap·qap·> q- awith> p·> qinside the item- ap·q- ap·> qCause
Format.deleteHandlermerges 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-itemor atask-list-item. For any other container the only-child walk removes just the merged paragraph, as before #4725.Type of change
Test plan
deleteMerge.spec.ts, real engine): the two documents above giveap\n\n> q\nand- ap\n\n > q\n. Both fail without the fix (qunquoted). 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 iftask-list-itemis dropped from the check.editing/delete-merge-blockquote-5423.spec.ts, Chromium, real click, End, Delete, then typingZ):aZp\n\n> q\nand- aZp\n\n > q\n, no page errors. Both fail without the fix.a, Delete, typeZ): 0.19.1 givesaZp/> q, 0.20.0-rc.3 givesaZp/q.packages/muya: all unit tests pass (1813),tsc --noEmitandcheck-circularpass; ESLint reports no errors on the changed files.cross-block-enter,paragraph-menu-in-table-or-code-4944andcut-rest-of-container-5385(7 passed).Notes for reviewers
this.getAnchor()host block and adds the list-item condition. With both fixes, a table's last cell followed by> p·> qgives2pwith> qstill quoted.afollowed by a list whose first item holdspandqstill givesapthenqwith the list gone, and a sublist inside a quoted list item still moves out of the quote.🤖 Generated with Claude Code