Fold sublist of first bullet if present rather than first bullet's entire list
jxpx777 opened this issue · 4 comments
Not sure whether to call this a bug or not, but it surprised me nonetheless. I was writing a list like this:
* Item 1
- Subitem 1
- Subitem 2
* Item 2
* Item 3
- Subitem 1
- Subitem 2
- Subitem 3
* Item 4
When I fold the list at Item 3, it folds just that bullet, hiding the sublist.
When I fold at Item 1, it folds the entire list that Item 1 is in and not the sublist.
I think if a bullet has a sublist, it should always fold the sublist first.
I think the behavior would work quite nicely because you could continue to have the down arrow as an affordance to further collapse the parent list and the …
affordance at the end of the line would still be available to unfold the sublist.
This is an interesting finding, thanks for opening the ticket.
I am not sure how it is implemented as the code was forked from CodeMirror's markdown package, will take a look.
It looks this is what we have from CodeMirror, try it out: https://codemirror.net/try/?example=Markdown%20code%20block%20highlighting.
I cannot explain, I am opening a discussion in https://discuss.codemirror.net/
Closing as a commit codemirror/lang-markdown@3d6fd9d was done by marijn, see the discussion for details.