Page MenuHomePhabricator

Scraped description text of images shows remnants of CSS transforms in MediaViewer
Open, Needs TriagePublic

Description

https://en.wikipedia.org/wiki/Scotland#/media/File:Scotland_in_the_UK_and_Europe.svg renders the description as:

Location of  .mw-parser-output .nobold{font-weight:normal}Scotland  (dark green) – in Europe  (green & dark grey) – in the United Kingdom  (green)

… instead of "Location of Scotland (dark green) – in Europe (green & dark grey) – in the United Kingdom (green)". The extra spaces and class are generated from https://en.wikipedia.org/wiki/Template:Infobox_country_UK as:

map_caption = {{{map_caption|{{map caption |location_color=dark green|country={{nobold|{{{common_name|{{PAGENAME}}}}}}} |subregion=the [[United Kingdom]] |subregion_color=green |region=Europe|region_color=dark grey}}}}}

… and these are leaking out.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr added a subscriber: Tgr.

Seems unrelated to PageImages. It's caused by TemplateStyles but not a problem with that component either, MMV just needs to be more intelligent about HTML parsing.

Change 478247 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/MultimediaViewer@master] Ignore TemplateStyle-generated content when textifying HTML

https://gerrit.wikimedia.org/r/478247

Change 478247 merged by jenkins-bot:
[mediawiki/extensions/MultimediaViewer@master] Ignore TemplateStyle-generated content when textifying HTML

https://gerrit.wikimedia.org/r/478247

jhsoby added a project: MobileFrontend.
jhsoby added a subscriber: jhsoby.

This is still happening on the mobile site. See attached screenshot I took just now from https://en.m.wikipedia.org/wiki/Ethnic_groups_in_South_Africa#/media/File%3ASouth_Africa_2011_dominant_population_group_map_(hex_cells).svg

It seems to only happen on the mobile site, not the desktop site with ?useskin=minerva: https://en.wikipedia.org/wiki/Ethnic_groups_in_South_Africa?useskin=minerva#/media/File:South_Africa_2011_dominant_population_group_map_(hex_cells).svg
So it might be MobileFrontend interfering somehow?

Screenshot_20231025_130541.png (1×1 px, 433 KB)

Change 968638 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[mediawiki/extensions/MobileFrontend@master] Remove style tags from captions in media viewer

https://gerrit.wikimedia.org/r/968638

Test wiki created on Patch demo by Jon Harald Søby using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/7e04caca21/w

Test wiki on Patch demo by Jon Harald Søby using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/7e04caca21/w/