Skip to content

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

Closed

Description

@Jocs

Description

Pressing forward Delete at the end of a paragraph that is followed by a blockquote merges the quote's first paragraph into it, as expected. It also moves every other paragraph of the quote out of the blockquote, so the quote disappears. MarkText 0.19.1 keeps those paragraphs quoted.

Steps to Reproduce

  1. Create quote.md with exactly this content:
    a
    
    > p
    >
    > q
  2. Open it in MarkText.
  3. Click just to the right of a, so the caret is at the end of the paragraph.
  4. Press forward Delete (⌦ on a full keyboard, fn+delete on a Mac laptop).
  5. Choose File > Save.

Same result with the paragraph inside a list item:

- a

  > p
  >
  > q

Expected Behavior

p is merged into a and q stays in the blockquote, as in 0.19.1:

ap

> q

Actual Behavior

q is no longer quoted, and the blockquote is gone:

ap

q

With more paragraphs in the quote (> q, > r), all of them lose the quote. The list-item variant gives - ap followed by a plain q inside the item.

No error dialog is shown.

Screenshots / Logs

No response

Operating System

macOS

MarkText Version

0.20.0-rc.3 (also reproduced on the current develop branch). 0.19.1 is not affected.

OS Version

macOS 27.0 (arm64)

Reproducibility

  • I can reliably reproduce this issue

Related

Checked by driving the packaged apps (click at the end of a, Delete, type Z): 0.19.1 saves aZp / > q, 0.20.0-rc.3 saves aZp / q.

Possible cause: Format.deleteHandler in packages/muya/src/block/base/format.ts. #4725 (fixing #1845) moves the blocks that follow the merged paragraph next to the current block whenever that paragraph sits in a different container. It is meant for list items, where the next item's nested sublist must travel up with its text, but the check does not require a list item, so the rest of a blockquote is moved too. A table's last cell followed by the same blockquote behaves the same way once #5386 is fixed (#5422).

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug🔭 area/muya🚧 needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions