Page MenuHomePhabricator

On some pages, some references disappear or render differently in Edit mode compared to Read mode
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • View the references on this artice: https://en.wikipedia.org/w/index.php?title=Min%C3%A9_Okubo&oldid=1182523114
    • There are 26 numbered references, and the first of them is "Hanstad, Chelsie; et al. (2004-03-05)"
  • Change to edit mode: https://en.wikipedia.org/w/index.php?title=Min%C3%A9_Okubo&action=edit
    • Now there are 23 numbered references and the order has changed. The previously-first Hanstad reference is now number 7.
    • The Notes section still renders the same way as in read mode, with superscripts within the explanatory footnotes, but those superscripts no longer match the corresponding references because of the change in order and number of references. (In the two cases where the references are only used within the footnote template, those references are absent from the References section altogether. In the case where the reference is also used with the text, the reference is still in the list but the number does not match.)

Read mode:

notes and refs - read mode.png (1×1 px, 470 KB)

Edit mode:

notes and references - edit mode.png (968×1 px, 415 KB)

What happens?:

It's very confusing for new editors when there are significant rendering differences with the references like this. This is especially confusing when an editor wants to make an edit related to one of the references that is not shown at all in Edit mode.

This case, I believe at least some of the differences are connected to the use of ref tags within templates, such as {{efn}} in this example: https://en.wikipedia.org/wiki/Template:Efn

What should have happened instead?:

References displayed in VisualEditor should be rendered the same way they will be in Read mode.

Other information (browser name/version, screenshots, etc.):

I assume there is an open issue for the more fundamental reason this kind of thing happens, but I couldn't figure out which one. I'm opening this one in the hopes that the additional example will be useful and/or that it will help provide a nudge in priority. This kind of thing is particularly hard to debug or work around for editors who don't have a pretty good mental model of templates and wikitext.

Event Timeline

The issue is indeed that some references are defined in places that VE can't know about. In this case it's the three that're defined inside the infobox parameters.

The renumbering is because of changes made in T54750 earlier this year to support letting people click in the reference list to directly edit references there. We always used to have this behavior of renumbering the list, but before it was only when you did something that actually made VE re-render the reflist that you'd see it happen, whereas now it happens when the editor is loaded.