Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Fix deleting styled blocks #3

Merged
merged 2 commits into from
Sep 22, 2017
Merged

Fix deleting styled blocks #3

merged 2 commits into from
Sep 22, 2017

Conversation

mxstbr
Copy link

@mxstbr mxstbr commented Sep 22, 2017

When the first thing in an editor is an styled block you cannot get rid
of it, it'll always stay styled, because backspace only deletes the
content.

This patch fixes the issue by introducing custom behaviour for this
specific condition: If we're in the first block of the editor, it's a
styled block, the block is empty and we press backspace we change the
block type to 'unstyled'.

Fixes ngs#31

When the first thing in an editor is an styled block you cannot get rid
of it, it'll always stay styled, because backspace only deletes the
content.

This patch fixes the issue by introducing custom behaviour for this
specific condition: If we're in the first block of the editor, it's a
styled block, the block is empty and we press backspace we change the
block type to 'unstyled'.

Fixes ngs#31
@mxstbr mxstbr merged commit b11c066 into master Sep 22, 2017
@mxstbr mxstbr deleted the fix-first-block branch September 22, 2017 09:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting a markdown block in the very first line
1 participant