I often use nested lists in my answers and came across the following problem:

When entering a nested list like

* A
  * B

pressing Shift+Enter causes the auto formatter to flatten the list to

 * A
 * B
 * List item

Note that this does not happen when simply pressing Enter, but it can be quite frustrating when you have built a more complex nested list hierarchy and accidentally press Shift during line breaks.

Possible solution

Instead of clamping all spaces in front of a bullet into a single one, compute the hierarchy level for every bullet and set spaces accordingly, while inserting new list item in the current hierarchy level.

EDIT: I'm using Firefox 54 (64 bit) on Ubuntu

  • I can't repro this on Chrome/Win10. If I press shift+enter in a list it inserts for me the text enter code here which is also confusing and doesn't happen when I'm on a normal line. My list doesn't get flattened in the test-cases I tried. – rene Aug 3 '17 at 7:59
  • I'm using Firefox/Ubuntu. enter code here only gets inserted if my current line is already indented by at least 4 spaces. – Tobias Ribizel Aug 3 '17 at 8:10

You must log in to answer this question.

Browse other questions tagged .