In a nutshell, list items are recursively parsed so there is always a RootNode at the start of an item. If the list item is wrapped in Para node because it had a blank line it breaks the pattern and makes it harder to work with the AST.
Simple solution is to wrap the list items children in RootNode( ParaNode ( children)) so that it is identical to what an unmolested loose list item would look like. This makes task list item HTML serialization hell because an <input> must be injected into the item. Much easier if the AST is consistent.
In a nutshell, list items are recursively parsed so there is always a RootNode at the start of an item. If the list item is wrapped in Para node because it had a blank line it breaks the pattern and makes it harder to work with the AST.
Simple solution is to wrap the list items children in RootNode( ParaNode ( children)) so that it is identical to what an unmolested loose list item would look like. This makes task list item HTML serialization hell because an
<input>
must be injected into the item. Much easier if the AST is consistent.Fixed with tests. PR in the oven.