Skip to content

Delete forward on empty line before code block unwraps code line #2686

@12joan

Description

@12joan

Description

When deleting forward from an empty paragraph immediately before a code block, the first line of the code block is unwrapped. This makes it impossible to remove such a paragraph if the code block should be at the start of the document.

Steps to Reproduce

  1. Go to platejs.org
  2. Create an empty paragraph followed by a code block containing at least two lines
  3. Place the cursor at the empty paragraph
  4. Delete forward
recording.mp4

Expected Behavior

  • If the paragraph is empty, delete forward should delete it without affecting the code block.
  • If the paragraph is non-empty, the current behaviour is acceptable.

This is consistent with lists:

recording.mp4

Bounty

Click here to add a bounty via Algora.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions