Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a markdown block in the very first line #31

Open
mxstbr opened this issue Jul 19, 2017 · 1 comment · Fixed by withspectrum/draft-js-markdown-plugin#3
Open

Comments

@mxstbr
Copy link
Contributor

mxstbr commented Jul 19, 2017

When I type a hash as the very first character, which converts the first line to a heading, I can never make that line leave heading mode again. Pressing backspace when there's no content left doesn't do anything. (the same thing is true for all other blocks too, like code)

Could we do something like: When the cursor is at the very first position in the editor and backspace is pressed revert that block to unstyled?

@mxstbr mxstbr changed the title Delete heading as first line Deleting a markdown block in the very first line Jul 20, 2017
mxstbr added a commit to withspectrum/draft-js-markdown-plugin that referenced this issue 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
@mxstbr
Copy link
Contributor Author

mxstbr commented Sep 22, 2017

I fixed this in my fork, feel free to cherry-pick the commit to upstream: withspectrum#3 a4ef4ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant