Recommended spec for list item content

Hi, long time user and sponsor of Prosemirror –

I recently realized that some of our users frustrations with lists come from the fact that the spec for list_item has been set as paragraph block*, this came from the recommendations in the GitHub - ProseMirror/prosemirror-schema-list: List-related schema elements and commands for ProseMirror but I’m unclear why the first item is enforced to be a paragraph.

In testing everything including splitting, wrapping etc seems to work fine with a simpler spec of block+. Any insight?

It’s common to force the first block in a list item to be a paragraph to forbid things like another list starting directly at the top of an item…

      • (markdown seems to be fine with that)

But there’s absolutely no harm in just making it block+ if that works better for you.

1 Like

Ah I see, that makes sense – I would rather not allow immediately nested lists like that if possible but all other blocks are fine. A spec format for for not would be super useful here, something like content: (block+ !listGroup)