Markdown: Customizing list tightness

Hi,

A project I help maintain uses a CodeMirror 6 editor with the default markdown list continuation.

Currently, pressing enter twice near the end of certain tight lists produces a non-tight list. Is there a way to customize this behavior?

For example,

  1. Start with the following document:
- This
    - is
    - a
    - test
  1. Move the cursor to the end of the last item.
  2. Press enter three times.

Currently, this adds a new non-tight list item. For example,

- This
    - is
    - a
    - test

- 

Instead, I would prefer similar behavior to when there are already multiple toplevel items in the list — the last item is removed and the cursor is moved to a blank line.

Thank you for any suggestions!

What you are describing sounds like the thing that is already implemented in this commit. Could it be that you’re running and old version of @codemirror/lang-markdown?

I’m also experiencing this in the CodeMirror try-it editor.

I see what you mean, but at that point the outer list only has one item, so it doesn’t seem unreasonable to give the user the choice between making it tight or non-tight. Nesting a tight list in a non-tight one is a thing that people do.