Context
- create wikitext:
<ref name="refname" details="page 4 {{Cite book|title=detail}}">This is a reference {{Cite book|title=main}}</ref>
==References==
{{Reflist}}- switch to Visual Editor
What happens?:
Visual Editor cannot display the reference and displays a warning instead
Implementation
- Write a test exercising the bug, or mark existing covering tests with this bug number.
- Revert any workarounds (can keep behind our dev-feature flag) which wire the main ref through a rendered {{reflist}}.
- Discussion: how should main content be wired in from Parsoid? Consider reflist template with more than one top-level element for the extreme example of why a synthetic ref shouldn't still sit on the rendered template.
- Dev-feature flag should prevent Parsoid synthetic ref (depending on outcome of the discussion).
- T417612: [Refactor] VE: Load main body content for sub-refs from DOM (re-evaluate whether this is a good step)
- TBD Make sure main content can be found in Parsoid when converting back https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/1170079
Notes:
The underlying issue also affects the previews in the context menu and when editing details.
The tricky case we want to support is an inline main+details in the article, which is then rendered inside a {{reflist}}. Sample wikitext above has been tweaked to reflect this. Our questions are:
- Will data-mw be present in Parsoid's reflist <li>, such that the wikitext of the main ref and details can be round-tripped?
- Yes, the reflist <li> contains full content needed to round trip.
- Is it possible to find the main footnote body in the DOM?
- Not yet. The DOM ID looks something like mw-reference-text-cite_note-main1-1 but this final "-1" cannot be predicted. See T406858: [refactor] Find a way to create a unique reference list item id in VE which might become a subtask here.
A major edge case to consider is that the main ref might be defined within a template, which means that VE should *not* be able to find its contents to reconstruct main content. We might not be able to detect this easily when pulling main content from the references list item. See T412007: VE unexpectedly copies reference content from one sub-ref to another if the main ref is defined within a template for an explanation of the issue.

