Page MenuHomePhabricator

Polling templates on Commons sometimes show an unwanted line break between the icon and the string
Closed, DuplicatePublic

Description

Polling templates error.png (900×1 px, 175 KB)

I am experiencing a bug with templates like {{not done}} or {{request}} where the icon and templated text are displayed with a line break between each other. It is also weird that this bug occurs seemingly randomly across a page and sometimes does not show up at all for hours. I'm using FF 59.0.2 (64 bit) but I can reproduce this behaviour in MS Edge.

This has also been reported at Commons:Village Pump.

Event Timeline

Aklapper changed the task status from Open to Stalled.Apr 26 2018, 6:30 PM

Thanks for reporting this.
I cannot see any example here in Firefox 59 on https://commons.wikimedia.org/wiki/Commons:Undeletion_requests or on https://commons.wikimedia.org/wiki/Commons:Undeletion_requests/Current_requests

When this happens, could you right-click on that item and choose "Inspect Element" and take a look if this line break is in the HTML itself, or in the CSS? For more information, please see https://developer.mozilla.org/en-US/docs/Tools/Web_Console for Firefox

Aklapper renamed this task from Polling templates rendering error to Polling templates on Commons sometimes show an unwanted line break between the icon and the string.Apr 26 2018, 6:31 PM

Apparently this occurs when the template is being used at the beginning of a line. When there is a bullet point or an indentation before the template, it renders normally. I got this code from my cache of that screenshot page and right now I'm also seeing such a pattern in https://commons.wikimedia.org/wiki/Commons:Undeletion_requests/Current_requests Note the p tags around the template icon in the first example.

<p><img alt="Symbol oppose vote.svg" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/15px-Symbol_oppose_vote.svg.png" width="15" height="15" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/23px-Symbol_oppose_vote.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/30px-Symbol_oppose_vote.svg.png 2x" data-file-width="180" data-file-height="185" />&#160;</p>
<bdi><b>Oppose</b></bdi>
That may or may not be true, but it is not a reason to restore this copyrighted logo. .&#160; &#160; &#160;<strong><strong>Jim</strong></strong> . . . <small><small><small><a href="/wiki/User:Jameslwoodward" title="User:Jameslwoodward">(Jameslwoodward)</a></small></small></small> (<a href="/wiki/User_talk:Jameslwoodward" title="User talk:Jameslwoodward">talk to me</a>) 12:50, 25 April 2018 (UTC)

vs

<li class="mw-empty-elt"></li>
<li><img alt="Symbol oppose vote.svg" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/15px-Symbol_oppose_vote.svg.png" width="15" height="15" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/23px-Symbol_oppose_vote.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/30px-Symbol_oppose_vote.svg.png 2x" data-file-width="180" data-file-height="185" />&#160;
<bdi><b>Oppose</b></bdi>
This image has (or these images have) appeared on the Internet without a free license prior to being uploaded here (or appear(s) to have based on the small size and lack of EXIF metadata), and was (or were) thus deleted by an Administrator. Therefore, policy requires that the actual copyright holder, which is almost always the photographer or image designer, must send a free license directly using <a href="/wiki/OTRS" class="mw-redirect" title="OTRS">OTRS</a>. If the underlying photo was taken in the 1940s or 50s, its copyright extends into the 2020s or 30s due to Spain's 80pma copyright law at the time. Please see <a href="/wiki/Commons:CRT#Spain" class="mw-redirect" title="Commons:CRT">COM:CRT#Spain</a> and <a href="/wiki/Commons:DW" class="mw-redirect" title="Commons:DW">COM:DW</a>. &#160; — <span style="font-size:115%;background-color:lightyellow"><a href="/wiki/User:Jeff_G." title="User:Jeff G.">Jeff</a> <a href="/wiki/User:Jeff_G./talk" class="mw-redirect" title="User:Jeff G./talk">G. ツ</a></span> <small><sub>please <a href="/wiki/Template:Ping" class="mw-redirect" title="Template:Ping">ping</a> or <a href="/wiki/User:Jeff_G./talk" class="mw-redirect" title="User:Jeff G./talk">talk to me</a></sub></small> 15:56, 25 April 2018 (UTC)</li>

The Firefox inspector tool shows some details for the p tag with the code inside the curly brackets being struck through though:

load.php:1@screen

{                                      

    margin: 0.4em 0 0.5em 0;
        margin-top: 0.4em;
        margin-right: 0px;
        margin-bottom: 0.5em;
        margin-left: 0px;

}

Inherited from div#mw-content-text

If this is related to gadgets or user scripts, https://www.mediawiki.org/wiki/Help:Locating_broken_scripts explains how to track the problematic script.

This doesn't seem to be related to any gadget or my common,js. I disabled all of them and got the same visual pattern in these templates. And yes, I did purge the page I was checking.

Zhuyifei at Commons has now identified the <bdi> tags as the culprit, and it has also been noted that the one nbsp in the template code is parsed as two separate blank spaces.

{{Support}} get expanded into [[File:Symbol support vote.svg|15px|link=]] '''<bdi>Support</bdi>''' This is perfectly valid mediawiki syntax and they should be inline. MediaWiki thinks otherwise.

The html rendering with <bdi> for some reason cause the <bdi>-block to be seperated from the parent <p>-block, for some reason.

zhuyifei1999 changed the task status from Stalled to Open.May 9 2018, 8:14 PM
zhuyifei1999 added a project: MediaWiki-Parser.
Vvjjkkii renamed this task from Polling templates on Commons sometimes show an unwanted line break between the icon and the string to x4daaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
Yann renamed this task from x4daaaaaaa to Polling templates on Commons sometimes show an unwanted line break between the icon and the string.Jul 1 2018, 10:28 AM
Yann updated the task description. (Show Details)
Yann added a subscriber: Aklapper.