User story:
As a VE user,
when I delete a sub-reference (that contains the main content)
and there is at least one other sub-reference for the same main content in the article,
then the main reference content should be preserved
so that valuable citation data is not accidentally lost and the remaining references continue to function.
Acceptance criteria:
GIVEN: two sub-references: [1.1] [1.2] with the following wikitext:
<ref name="book" details="page 1">Miller 2025</ref> <ref name="book" details="page 2"/>
WHEN I delete [1.1] (line 1 in wikitext: the sub-ref that is containing the main ref data)
THEN the content of the main ref is still available in the context item for "[1.1]" and in the references list under "1."
AND when saving to wikitext, the main ref is moved into line 2 (the nearest one in the document). Resulting wikitext:
<ref name="book" details="page 2">Miller 2025</ref>
Out of scope
- Saving back to wikitext is currently broken and will be fixed in a separate task.
Boundaries:
- If only a reuse of the main reference exists and no other sub-references then it is fine for now that VE moves the main content to a new ref tag in the references list. This will change at a later stage.
- Do not move into infobox or other templates.
Link to internal board:
Technical notes:
- This logic already exists for normal refs, look for how the contentsUsed flag is set and maintained.
