Page MenuHomePhabricator

mw-deduplicated-inline-style showing up in article
Closed, InvalidPublic

Description

When visiting https://en.wikipedia.org/wiki/Fusion_power#1970s
After an edit to https://en.wikipedia.org/wiki/Template:Multiple_image to use template styles, the Fusion article is displaying like so:

Screen Shot 2018-08-15 at 12.36.09 PM.png (382×1 px, 164 KB)

Screen Shot 2018-08-15 at 12.36.35 PM.png (330×1 px, 291 KB)

HTML shows the style is being wrapped in a pre tag which is subject to styling in the article.

<pre><style data-mw-deduplicate="TemplateStyles:r854463611">@media all and (max-width:720px){.mw-parser-output .tmulti>.thumbinner{width:100%!important;max-width:none!important}.mw-parser-output .tmulti .tsingle{float:none!important;max-width:none!important;width:100%!important;text-align:center}}</style>
</pre>

Is this an issue with how the template has been applied or a bug in the software (if the former, please add some linting to stop this from happening again)

Event Timeline

Workaround is to not put the templatestyles tag on a separate line.

Anomie subscribed.

There is also an extraneous space before the invocation of the template in the article, which causes MediaWiki to try to display the line as preformatted text, but only when not inside an existing "block".

When the {{#invoke:}} is on the first line of the template, the <div> it produces causes BlockLevelPass do decide that line is starting a "block" and suppresses the space's creation of the <pre> block.

This edit removing that space gets rid of the <pre> block with the old version of the template for the 1970s section. Someone should make a similar edit for any other occurences.