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.
Summary
Trying to address some of the reproducible bugs in current markdown editor. The ultimate plan is still to upgrade the editor to Plate and have high hopes that that will fix most of the problems, but in the meantime we can try to patch some of the most annoying ones.
First fix is for #7220 - where converting markdown without text (but newlines, breaks or spaces) would result in a slate root without paragraph node.
Second fix is for #7123 - a case where backspace in urls contained in lists breaks the editor
The third fix is for losing focus after pressing backspace when previous element (or especially two elements) are soft breaks.
Test plan
#7220
Switch to markdown mode, add a space or a line break, switch back to richtext mode and hit shift+enter. The editor should no longer crash.
#7123
Create a bullet list with two items. In the second change some of the text to link. Then use backspace at the start of that link. The editor should not crash. Keep using backspace until the bullet is removed and the editor should also not crash then.
Hit shift+enter three times and then backspace. Before this, the editor would not crash, but still lose focus.
Checklist
Please add a
x
inside each checkbox:A picture of a cute animal (not mandatory but encouraged)