Challenges with Using prosemirror-schema-list

图片 When I use prosemirror-schema-list, the generated list structure always wraps <li> with <p> tags. I want the generated list structure to have <li> directly containing inline elements. Is there any way to achieve this? It seems that the addListNodes function can only be configured like this: addListNodes(basicNodes, "paragraph block*", "block"). Once I change it for other lists, it doesn’t generate the desired structure.

That’s too vague a problem description for me to do anything with.

I want to implement a list structure where the ‘li’ label directly wraps the text, but I don’t know how to set the value passing parameter addListNodes (basicNodes, “paragraph block *”, “block”) of this function

Have you tried passing "inline*" as first parameter?

Is it like this? This is the command I execute after clicking the button, and then the list will not be generated

Ah, I see. wrapInList will try to wrap the block around the cursor in a list, which doesn’t work if list items cannot contain blocks, so you’ll need another type of list-creation command for this type of list (which the package doesn’t provide).

I am implementing a requirement to bring the style of the list to the next item when I press Enter on the keyboard. However, currently Enter is bound with the command to copy the style, and when I press Enter on the keyboard, I cannot generate the next item