Page MenuHomePhabricator

In VisualEditor, references in templates cannot be reused and are numbered separately from references in the text.
Open, MediumPublic

Description

References added by templates are currently not very well integrated into the VisualEditor UI. Their footnotes are visible as Parsoid parsed output on the surface, but:

  1. the number in square brackets on the footnote does not necessarily fit with other numbers visible from other footnotes
  2. they do not appear in the reference lists in the editor
  3. they do not appear in the list of references to re-use

A simple demonstration of the first two issues can be seen here:

ReadingVisualEditor
TemplateGeneratedRefs-Reading.png (461×338 px, 37 KB)
TemplateGeneratedRefs-VE.png (442×296 px, 25 KB)

For example, look at this old version of w:en:Popocatépetl. It has 21 references, 3 of them in the infobox only. When you open it in VE, those first 3 cannot be accessed from the re-use menu. In addition, all 21 appear in the references list, but each reference x in the text corresponds to entry x + 3 in the references list.

See Also:
T52505: VisualEditor: Share ref / references re-rendering code with Parsoid
T53289: References inside templates don't appear in the reference list in VisualEditor
T54398: References in blockquote invisible outside it; reflist outside blockquote invisible inside it
T55777: De.WP's quote template eats refs (or gets eaten)
T54262: Referenced footnote not displayed correctly in VE using Chrome 28 on Win 7

Possible duplicate but might have additional implications:
T87134: References generated by a template in media captions do not appear in Re-Use Reference list

Details

Reference
bz50474

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
GermanJoe subscribed.

See en-Wiki feedback "Citation numbers messing up". This problem is repeatedly mentioned on en-Wiki, confuses editors and hinders editing of developed articles with complex reference structures. I would like to propose the whole issue with "references in templates" and "references generated by templates" as blocker. I am aware, that 5 other tasks are possible related to this problem (See also), maybe the whole topic area needs another fresh look for a solution. - the problem is known for almost 2 years now, and should get a higher priority and more frequent updates on its status.

In the weekly triage meeting on 2015-05-06, we discussed this task. Though we acknowledge that this is moderately confusing for users, fixing this is a very large piece of work (which reflects why it has not been completed in the past two years either). I've marked this as blocked by a piece of work that we hope to finish out this quarter, which will hopefully help make this slightly less epic to fix.

nshahquinn-wmf renamed this task from VisualEditor: References created by templates numbered alone, not with the rest of the page, and don't show up as references to insert to References in templates are numbered separately from references in the text and cannot be reused in VisualEditor.Jun 16 2015, 2:04 AM
nshahquinn-wmf updated the task description. (Show Details)
nshahquinn-wmf renamed this task from References in templates are numbered separately from references in the text and cannot be reused in VisualEditor to In VisualEditor, references in templates and image captions cannot be reused and are numbered separately from references in the text..Jun 16 2015, 8:47 PM
nshahquinn-wmf updated the task description. (Show Details)
nshahquinn-wmf renamed this task from In VisualEditor, references in templates and image captions cannot be reused and are numbered separately from references in the text. to In VisualEditor, references in templates cannot be reused and are numbered separately from references in the text..Jun 16 2015, 9:01 PM
nshahquinn-wmf added a project: Epic.

As a stop-gap measure, is it feasible to have the footnotes that are contained in templates (and therefore not "in" the document) be displayed differently? You would get the usual [1] for whatever is the first footnote in the article body, but the first one in an infobox would be marked as [X] or [Template 1] or something that doesn't match the typical ones.

This information is already shown in context and the reference list. If we change the numbering that will probably be more confusing.

Since T114105 was merged into this ticket, is there anything I could do to help solve this issue?

Since T114105 was merged into this ticket

In case anyone following that original ticket (or several like it) is confused about why these get merged here:

VisualEditor handles regular "Harvard" (parenthetical) citations perfectly; see true Harvard style at https://en.wikipedia.org/w/index.php?oldid=521737742&veaction=edit as an example. Plain Harvard is just plain text, after all; a proper Harvard citation is just (Author Date) with an optional page number. Any system that lets you type common characters can handle plain Harvard citations.

The problem is when it's not truly Harvard citations, but instead it's a non-Harvard short citation wrapped up in ref tags using a template such as {{sfn}} – when the system is presented with {{sfn|Author|Date|123}} instead of <ref name="Author Date">Author Date, page 123.</ref> (which VisualEditor can handle) or (Author Date, page 123) (which VisualEditor can also handle).

In that case, the main technical issue is exactly the same as {{infobox|field=data<ref>Source</ref>}}: the ref is stuck in a transclusion rather than in the article being edited. This has multiple effects, including impossible numbering and bad displays (because the transcluded doc gets its own <references /> list; see T114105 for a screenshot). As I understand it, some of these problems will be solved here, and others may be fixed through other mechanisms, e.g., T110909: Parsoid tripped up by extensions that process wikitext. But the bugs get merged here, because it's not possible to merge them to multiple related tasks.

Solving this (and its subtasks) would be a huge success. I'd be grateful.

I took the freedom to summarize the overall problems surfacing in this task. I guess it makes sense to try to solve the first two issues described so it's less confusing for the users.

The third options seems not so straight forward at the moment. Templates of any kind can include a references and it would be unclear on how a re-use should look like or even how a reference transcluded from a template can get a name that's needed for the re-use.