This repository was archived by the owner on Oct 11, 2022. It is now read-only.
fix: only insert empty block for headers and blockquote when at end of line #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The last PR went so well, I thought I'd keep going 👍
I found it odd when using this plugin that pressing enter at any time when within a header or blockquote block adds a new line and jumps to it. This PR ensures that the user is at the end of the line before that happens.
Before
## He[CURSOR]ader
pressing enter becomes...
## Header
[CURSOR]
> Blockquo[CURSOR]te
pressing enter becomes...
> Blockquote
[CURSOR]
After
## He[CURSOR]ader
pressing enter becomes...
## He
## [CURSOR]ader
> Blockquo[CURSOR]te
pressing enter becomes...
> Blockquo
> [CURSOR]te
I personally think this is a more intuitive behavior.
I based my knowledge of testing if we're at the end of the line from: