Page MenuHomePhabricator

MediaViewer needs mw-parser-output class to display TemplateStyles correctly
Open, Needs TriagePublic

Description

MediaViewer captions have no .mw-parser-output class, which means that they only conserve inline styles provided in HTML element and not the TemplateStyles that can be defined on the page.

In the case of some templates, like Template:Legend, that can lead to substandard rendering of the caption. If .mw-parser-output was added, the styles from TemplateStyles declaration would work.

Example:
https://en.wikipedia.org/wiki/Intersex_rights_in_the_United_Kingdom#/media/File:Inclusion_of_sex_characteristics_in_anti-discrimination_law.svg

Event Timeline

FWIW MediaViewer strips most HTML from the description (e.g. the <div>s in the linked example). In general, figuring out a structured way of storing things like legends is a better way forward in my opinion.

Well, in the case here it takes the caption from the page itself, without removing <span> tags. I’d think it’s only natural that any styling defined for them should work in the captions inside MediaViewer, too.