Story:
When an editor adds the sub-reference after the main ref to wikitext and it also contains main ref data, the wikitext should be unchanged after using VE.
Acceptance criteria:
Assume Wikitext like this:
<ref name="main">The book</ref> <ref details="p. 123" name="main">The book</ref>
- Should show as [1][1.1] in Parsoid output
- Should show as [1][1.1] in VE ouptut
- When editing something outside that ref in VE and saving again the Wikitext should stay the same
- When editing the sub content the Wikitext structure should stay the same
Implementation
Currently, we won't include the mainBody attribute if the main ref was already parsed. Find the existing main ref, read its $mainRef->noteId and store in the subref's mainBody.
If this can also be calculated for a main ref which *wasn't* seen yet, even better—it can be calculated directly from the main ref name.
Out of scope:
Editing the main content in this case will lead to a situation where the main content will only be changed in one of the two references. This is already broken independent of the sub-ref feature.