Steps to replicate the issue
- Create a page using a sub + main reference defined within a template. Example:
{{Infobox Unternehmen <!-- Any template reproduces the issue, but infoboxes are the most frequent use case -->
|Gründungsdatum =<ref name="Test" details="S. 1">Test</ref>
}}
== Test ==
Test.<ref name="Test" details="S. 2" />
== Einzelnachweise ==
<references />- Edit the page in VisualEditor and make any minor edit in the article text.
What happens?
- Notice how VE shows the main ref content but not the first sub-ref (S. 1) – that's not very surprising because VE always struggles with refs inside templates (e.g. T350064 / T355858)
- When saving your VE edit, the main ref content gets copied to the sub-ref in the article text (and T403379: VisualEditor automatically writes out self enclosed <references /> tags (unintended diff) occurs). Example:
{{Infobox Unternehmen
|Gründungsdatum =<ref name="Test" details="S. 1">Test</ref>
}}
== Test ==
TestTest.<ref name="Test" details="S. 2">Test</ref>
== Einzelnachweise ==
<references>
</references>What should have happened instead?
- <ref name="Test" details="S. 2" /> should have stayed the way it was instead of changing to <ref name="Test" details="S. 2">Test</ref>
Other information
- Copying main ref content to another sub-ref increases the risk of reference errors – next time I edit the main ref without realizing there's a second sub-ref with main ref content it will lead to a reference error (example) – which I might not even notice because VE doesn't show it while editing. Reader's view after saving the page:
- VE behaves differently if the main ref is just a re-used ref without sub-references. Example:
{{Infobox Unternehmen
|Gründungsdatum =<ref name="Test">Test</ref>
}}
== Test ==
Test.<ref name="Test" />
== Einzelnachweise ==
<references />- Leads to this view while editing in VE:
- ... which does not result in any changes to the references (example) – the reported issue is specific to sub-refs defined within templates.
- Reported onwiki: https://de.wikipedia.org/wiki/Wikipedia:Technik/Werkstatt#VE_tut_ungefragt_Dinge_(3)
Next steps
- Investigate the root issue
- Discuss possible solutions



