Page MenuHomePhabricator

Cannot use templates in <gallery> caption
Closed, DeclinedPublic


Author: vlakoff

If I do:

<gallery caption="foo {{some template}} bar">
Image_PlaceHolder.png|Caption of the picture

... the caption isn't expanded at all and displays as "foo {{some template}} bar"

If I do:

Image_PlaceHolder.png{{!}}Caption of the picture
|caption=foo {{some template}} bar

... The caption is expanded but HTML code is escaped so it displays as "foo <span><div><sup>[etc.] bar"

An example is provided here:

Expected result: The caption should be expanded, ideally in both cases; sadly I presume it would require to add a new syntax, because of the first case.

In order to prove the usefulness of the asked fix:

  • there is no problem in putting HTML elements into a <caption> element[1][2], in case <gallery> would use this element in the future
  • on the French Wikipedia we are working on making accessible abbreviation templates, using <abbr>[3], so that their result is readable by speech synthesizers.




Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 11:57 PM
bzimport added a project: MediaWiki-Templates.
bzimport set Reference to bz31517.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Oct 8 2011, 9:30 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 14 2015, 11:12 PM

It's not just templates, the parser only calls replaceInternalLinks on the caption. So, in general, wikitext isn't supported in the gallery caption attribute.

Jdforrester-WMF closed this task as Declined.Mar 25 2017, 3:05 AM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

We're not intending to do this. Ideally we'd block the #tag hack as well.

Base added a subscriber: Base.May 3 2017, 10:51 PM

Any reasoning?

matmarex updated the task description. (Show Details)Feb 21 2018, 7:36 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptFeb 21 2018, 7:36 PM