Try an exploratory wiring of the internal VE representation of sub-refs back to the expected output that then can be saved. This task is done when the work has been defined, no implementation needs to be finalized here.
Requirements:
- Never save the main ref as list defined ref ( unless it was one )
- If the main ref content is inlined with the sub, make sure it's inlined in the output
- If the main ref content was separate from the sub, make sure it's separate in the output
- Write round-trip tests for VE data model<->Parsoid DOM in ve.dm.citeExample.domToDataCases
- Write round-trip tests for wikitext<->Parsoid DOM in Cite subReferencing.txt
Investigation notes:
- Reintegration should be symmetrical with where we split main from details, in other words it should happen in Parsoid and not VE. VE is responsible for rebuilding a Parsoid-like DOM in which the main + subref look almost like normal refs other than some additional linking attributes. This also means that Parsoid is where the details attribute is sanitized and escaped.
- But by careful ordering, it might be possible to reuse existing contentsUsed logic almost unchanged. The trick would be to deduplicate *either* the contents of a normal ref, or the main body content which has become a synthetic, list-defined reference.
- VE includes some logic for how to handle reused subreferences—this should be removed for now.
- To play with round-tripping, edit the following header line in subReferences.txt: parsoid-compatible=wt2html,html2wt
- Parsoid html2wt is contained in the files RefTagHandler.php and ReferenceListTagHandler.php .