Our current approach for saving wikitext replies via Parsoid is:
- Add new list at required depth for reply, to Parsoid DOM
- For each line of the reply, add a list item
- In each list item, add a <span typeof="mw:Transclusion" data-mw="{parts:{wt:WIKITEXT_LINE}}"></span>
This results in a space between the list markup and the wikitext line: ::: WIKITEXT_LINE which is usually fine, except when the user tried to add a list, then you get ::: * LIST which doesn't render correctly.
Our current workaround is to add data-parsoid="" to the list item which tricks Parsoid into not rendering whitespace, but is very hacky and fragile.
In the long term this would be fixed by multi-line list syntax, but we may want something more stable in the medium-term.