Page MenuHomePhabricator

In the references section, visual editor should display references from inside of templates
Open, Needs TriagePublicBUG REPORT

Description

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

  • Create a page with
{{Infobox
|title=Test1<ref>https://test1.com/</ref>
|above=Loren ipsum
}}

Test2.<ref>https://test2.com/</ref>

== References ==
  • Click visual edit

What happens?:

  • Only one reference is displayed

image.png (231×1 px, 22 KB)

What should have happened instead?:

  • Two references should be displayed

image.png (244×1 px, 31 KB)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

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

Event Timeline

Novem_Linguae renamed this task from Visual editor should display references inside of templates in the references section to In the references section, visual editor should display references from inside of templates.Sep 21 2025, 5:24 AM

It's a very long-standing issue. You may be interested to see T52896, which has some discussion of the reasons.

T404608 is something I'm pushing for because I was trying to fix some list-defined references issues (T356471) and ran into needing to find uses inside templates as a blocker. There's a patch with a painful way of extracting that information, but I'm hoping Parsoid can be extended to give us more information up-front for it. (Even just getting a commitment from Parsoid that the Parsoid-specific attributes will always be included inside nested templates would be enough to let the painful method work... but having the data hoisted up for us would avoid all kinds of recursion / nested-layers-of-parsing issues.)

(It's not really worth having a bunch of related-tickets for this, because they're all just symptoms of "Parsoid doesn't tell VisualEditor about references that are inside templates", and if that's fixed then everything will start working. Albeit maybe with us needing to go verify we're not making assumptions that reference-definitions we're told about can actually be modified.)

Thanks for the info. T404608: Parsoid should provide top-level information about elements within templates seems like it'd be a good parent ticket. That should solve both of the micro-tickets I filed. Will make that the parent for now.

T350064: References defined in templates disappear or render differently in Edit mode compared to Read mode looks like an even better parent. Will make the relationship like this:

    T404608
     |
    T350064
     |    |
T405156  T405155