Page MenuHomePhabricator

Strange spacing before [[irc:...]] links
Closed, ResolvedPublic

Description

Author: mike.lifeguard+bugs

Description:
Links to [[irc:Whatever|#whatever]] seem to have extra blank space (like a \qquad or something - but can't be highlighted) before the link. Doesn't affect other interwiki links. Seems not to affect normal external links to irc://...

This may be a browser thing (though I've not switched or upgraded recently & certainly wasn't the case previously) - I'm using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)


Version: 1.15.x
Severity: normal
URL: http://meta.wikimedia.org/wiki/IRC/wikimedia-admin

Details

Reference
bz18207

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:34 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz18207.
bzimport added a subscriber: Unknown Object (MLST).

mike.lifeguard+bugs wrote:

extra space before the link

Attached:

mike.lifeguard+bugs wrote:

more extra space before the link

Attached:

mike.lifeguard+bugs wrote:

No extra space here... these are external links: [irc://whatever... #channel]

Attached:

ahmad.m.sherif wrote:

proposed patch

Another follow up on bug 1061. This patch would help.

attachment external.patch ignored as obsolete

brion added a comment.Apr 30 2009, 9:12 PM

Taking a peek.... patch doesn't look quite sufficient. In addition to IRC there may be other protocols which may match with the same styling issues.

There's also an entry which looks like it's attempting to entirely turn off the styling icons for interwikis:

/* disable interwiki styling */
#bodyContent a.extiw,
#bodyContent a.extiw:active {
color: #36b;
background: none;
padding: 0;
}

It looks like the CSS override order rules are leaving at least the IRC link matching anyway on normal view (perhaps because of the explicit #bodyContent a.extiw[href ^="irc://"] rule), while when it's being clicked the #bodyContent a.extiw:active selector takes over and the padding and icon can be seen to disappear.

Perhaps removing that #bodyContent a.extiw[href ^="irc://"] selector would do the job better? Why's it even there?

brion added a comment.Apr 30 2009, 9:13 PM

Adding a sample URL to the bug entry.

ahmad.m.sherif wrote:

patch per comment#5

patch per comment#5

Attached:

The strange spacing is regression from r47615 where both side padding has been added instead of single-side, but has not been overriden back to single-side for .extiw class.

Fixed in r50102.

ahmad.m.sherif wrote:

(In reply to comment #8)

The strange spacing is regression from r47615 where both side padding has been
added instead of single-side, but has not been overriden back to single-side
for .extiw class.

Fixed in r50102.

This looks like my first obsolete patch which brion reviewed in c#5. As he indicated, when you click on the irc link, the icon will disappear.

Removing /* disable interwiki styling */ section should solve the problem. (Why actually would we want interwikis to not be styled (= have icons nearby)?)

I'll look deeper a bit later on. For the time being I'd suggest to pull back r47615 which causes that.

herd wrote:

Raising the specificity on the extiw rules (except the last) also seems to work, eg:

#bodyContent a[href ^="irc://"],
body #bodyContent a.extiw[href ^="irc://"],
.link-irc {
background: url(discussionitem_icon.gif) center right no-repeat;
padding: 0 18px;
}

.rtl #bodyContent a.external,
body.rtl #bodyContent a.extiw {
background-position: left;
padding-right: 0;
}

.ltr #bodyContent a.external,
body.ltr #bodyContent a.extiw {
padding-left: 0;
}

Someone might pursue this line of inquiry, but I don't have the resources to test it

ahmad.m.sherif wrote:

(In reply to comment #10)

I'll look deeper a bit later on. For the time being I'd suggest to pull back
r47615 which causes that.

r47615 only causes the spacing before the links, but the disappearance of the icon wouldn't change.

brion added a comment.May 1 2009, 11:50 PM

r50102 is indeed the bad patch. Makes more sense to remove the selector which adds the icon and padding we apparently don't want in the first place...? Or if it was added deliberately, then it needs to be fixed to work consistently.

ahmad.m.sherif wrote:

proposed patch

A more suitable patch against against r50121.

Attached:

It seems to me that the bug could easily be fixed by disallowing interwiki prefixes which link to non-HTTP protocols. We've had trouble with this before, with js:, etc. Some protocols have security implications. There's a perfectly good way to link to the IRC protocol, there's no need to add interwiki prefixes.

Proposed fix in r51457.

mike.lifeguard+bugs wrote:

Looks fixed to me.

TheDJ added a comment.Oct 2 2011, 4:51 PM

Applied this to the other skins in r98690