Node conversion while applying an input rule

I’m trying to use the usual list input rule that wraps a paragraph in a list_item. However my schema doesn’t define list_item content as a paragraph block* but as text* (which is itself defined as {inline: true}).

As a result, the input rule fails to wrap my node because findWrappingInside() fails to match my current paragraph as some future inline content (as it is not allowed by my schema).

How could I make this work while maintaining the inline text constraint for list_items content? I guess should unwrap my current paragraph contents on the fly but it is not clear how/when/where to do that for me know. Also, doing such paragraph unwraping before being sure that the list_item wrapping will succeed seems risky to me (and I assume that I don’t have a simple way to know that an input rule failed).

Thank you

I think you’ll have to write your own input rule from scratch, since wrappingInputRule can only strictly wrap your textblock in new nodes, and won’t ‘unwrap’ the paragraph.