Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.39k stars 315 forks source link

Parsing of nested lists #423

Open fonol opened 2 years ago

fonol commented 2 years ago

Hi, I am using the classes added by CodeMirror to style lists in the edit mode. CodeMirror adds a cm-formatting-list-ul / cm-formatting-list-ol class to each list marker (+-*). This makes it very convenient to already style these list items in edit mode. However I noticed that these classes are only applied on the outermost level. E.g. in the example below, the * before sub list item 1 won't get the cm-formatting-list-ul class. If anyone could point me into any direction on how to get EasyMDE or CodeMirror to also parse these nested lists, that would be great!

- list item 1
- list item 2
    * sub list item 1
    * sub list item 2
Ionaru commented 2 years ago

You're mixing different characters in the list, it should work but I can imagine that would throw off CodeMirror.

Try:

* Fruit
  * Apple
  * Orange
  * Banana
* Dairy
  * Milk
  * Cheese

However in my tests I did get the cm-formatting-list-ul class on the nested list *. image