Skip to content

Undo after typing --- should restore the dashes, not delete the divider #3153

Description

@virgile-dev

The problem

Typing --- at the start of an empty block converts it to a divider. Pressing Ctrl/Cmd+Z right after does not bring back the three dashes: the divider stays.

Steps to reproduce

  1. Place the cursor in an empty paragraph block.
  2. Type ---.
  3. The block becomes a divider.
  4. Press Ctrl+Z (Cmd+Z on macOS).

Current behavior

The divider disappears. There is no way to get back to the literal --- text with undo.

Expected behavior

The first undo reverts the automatic conversion only and leaves --- as text in the paragraph, with the cursor after the last dash. A second undo then removes the typed characters as usual.

This is what Notion does, and it matches how users treat autoformatting in most editors: undo is the escape hatch when the editor guessed wrong.

Why it matters

Someone who wants three literal dashes (a separator in plain text, a markdown snippet, a table sketch) currently has no obvious way to keep them. They have to delete the divider and find a workaround to type the characters without triggering the rule. A conversion the user did not explicitly ask for should be reversible in one keystroke.

Environment
Tested on blocknotejs.org

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions