Currently references coming from template transclusions are not very well represented when using the VE. This is the root for several problems when dealing with them in the UI.
See for example
T215867: Visual editor reference auto name may collide with existing ref names when the existing reference comes from a template tranclusion
T52474: In VisualEditor, references in templates cannot be reused and are numbered separately from references in the text.
To fix some of these issues, especially with correctly numbering the references, avoid naming collisions and make transcluded references more visible to user they should probably be part of the ve.dm.InternalList of the document.
Goals:
- References should be numbered in the VE preview according to their numbering in the article text
- The referencelist preview in VE can generate a list with all references, their content and numbering like in the article text
- When named references from transclusions are part of the article, newly created references and their re-uses won't lead to naming conflicts with existing names
- References from transclusions should not be selectable in the re-use dialog
Acceptance criteria:
- All references from transclusions are part of the internalList of the current document
- It should be possible to distinguish references coming from template transclusions from other references
- Ideally it should be possible to identify which reference was transcluded from which template
Note:
This is not about re-using of references coming from template transclusions. That's a pretty big, complicated and in parts unclear task.
Maybe related:
T214241: data-mw info is clobbered by template annotations