decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.65k stars 1 forks source link

Markdown stability patch #7238

Open demshy opened 3 days ago

demshy commented 3 days ago

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 https://github.com/decaporg/decap-cms/issues/7220 - where converting markdown without text (but newlines, breaks or spaces) would result in a slate root without paragraph node.

Second fix is for https://github.com/decaporg/decap-cms/issues/7123 - a case where backspace in urls contained in lists breaks the editor

Test plan https://github.com/decaporg/decap-cms/issues/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.

https://github.com/decaporg/decap-cms/issues/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.

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)