You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backspace only removes one formatting character from an empty formatting snippet #468
When a formatting shortcut inserts an empty Markdown formatting snippet, pressing Backspace before entering any text only removes a single formatting character instead of removing the entire snippet.
This affects all formatting shortcuts.
Steps to reproduce
Create or open a note.
Use any formatting shortcut (for example, Ctrl+B for Bold).
Without typing any text, press Backspace.
Expected Behaviour
If no text has been entered, pressing Backspace should remove the entire inserted formatting snippet in a single action.
For example:
Bold: **|** -> (removed completely)
Italic: *|* -> (removed completely)
Strikethrough: ~~|~~ -> (removed completely)
Highlight: ==|== -> (removed completely)
Inline code: | -> (removed completely)
Actual Behaviour
Only a single formatting character is removed, leaving incomplete Markdown.
Examples:
Bold: **|** -> *|**
Italic: *|* -> |*
Strikethrough: ~~|~~ -> ~|~~
Highlight: ==|== -> =|==
Inline code: | -> |`
Additional Notes
This issue is reproducible with every formatting shortcut tested, suggesting the behaviour is not specific to a single formatting selection.
Pressing Backspace inside a just-inserted empty formatting snippet now removes the whole pair in a single press instead of one marker character. This works for every formatting shortcut:
Bold **|**, Italic *|*, Strikethrough ~~|~~, Highlight ==|==, Inline code `|`, Math $|$ → all cleared completely.
It matches on the longest marker first, so **|** clears all four characters, not *|*. A snippet that already has text (**text|**) is untouched — Backspace deletes normally there. The handler is gated the same way as the auto-close/auto-pairs behavior (active while typing — Vim off or Vim insert mode), so it never interferes with Backspace as a motion in Vim normal mode.
Verified in the running app (Ctrl+B → **|** → one Backspace → gone) and with unit + editor-keymap tests covering every marker.
Activity
Fix(editor): Backspace removes the whole empty formatting snippet (#468)
adibhanna commentedon Jul 24, 2026
Fixed.
Pressing
Backspaceinside a just-inserted empty formatting snippet now removes the whole pair in a single press instead of one marker character. This works for every formatting shortcut:**|**, Italic*|*, Strikethrough~~|~~, Highlight==|==, Inline code`|`, Math$|$→ all cleared completely.It matches on the longest marker first, so
**|**clears all four characters, not*|*. A snippet that already has text (**text|**) is untouched — Backspace deletes normally there. The handler is gated the same way as the auto-close/auto-pairs behavior (active while typing — Vim off or Vim insert mode), so it never interferes withBackspaceas a motion in Vim normal mode.Verified in the running app (
Ctrl+B→**|**→ oneBackspace→ gone) and with unit + editor-keymap tests covering every marker.Ships in v2.17.0.
Fix(editor): keep the outer pair when toggling a second format inside it
Fix(editor): Backspace inside an empty Ctrl+K link removes the whole …