Page MenuHomePhabricator

[Task] Avoid id="coordinates" in HTML ArticlePlaceholder output
Closed, ResolvedPublic

Description

On http://en.wikipedia.beta.wmflabs.org/wiki/Special:AboutTopic/Q12480 the "coordinates" are places very weird. Reason is that some unrelated CSS kicks in, because the HTML renders as <span id="coordinates">, and this does have a special meaning on Wikipedia pages for a long time. ArticlePlaceholder should avoid creating HTML with this ID.

Details

Related Gerrit Patches:
mediawiki/extensions/ArticlePlaceholder : masterAvoid id="coordinates" in HTML ArticlePlaceholder output

Event Timeline

thiemowmde assigned this task to Lucie.
thiemowmde raised the priority of this task from to Normal.
thiemowmde updated the task description. (Show Details)
thiemowmde added subscribers: thiemowmde, Lucie, hoo.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 5 2016, 2:36 PM
hoo added a subscriber: daniel.EditedFeb 5 2016, 3:49 PM

This is MediaWiki magic, it takes the value of the h2 ArticlePlaceholder sets and makes it into a wrapping span id.

It converts <h2>Content</h2> into <h2><span class="mw-headline" id="Content">Content</span></h2>. Not sure how you would fix this…

I honestly have no idea. :-( The "fun" thing is that this issue also exists in regular articles! Edit one, add ==coordinates== and hit preview. Surprise! This should be fixed.

hoo added a comment.EditedFeb 8 2016, 12:03 PM

Hm… this is really awry. So core sets these ids in order to allow linking to sections, thus just renaming these probably wont work.

The best solution would be for the actual coordinate class to get prefixed (like page-coordinates or top-coordinates or something like that). Core could be hacked to avoid setting these ids and not loose functionality (at least for JS enabled users), but I doubt it's worth the hassle.

We could also just use divs for these and style them ourselves, that would work around core's headline handling. Not sure that's desired though… semantically these are (kind of) headlines.

The most correct solution would be to fix the unspecific #coordinates selector in all local CSS files:

Fixing either by making it more specific, which is not possible, unfortunately. Or by disabling the styles for headlines:

h2 #coordinates,
h3 #coordinates {
    position: static;
    float: none;
    font-size: unset;
}
Lucie moved this task from Incoming to To Do Next on the ArticlePlaceholder board.May 3 2016, 12:36 PM

On enwiki this #coordinates CSS ID exists since at least 2009, see https://en.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&oldid=300108010.

Change 286664 had a related patch set uploaded (by Lucie Kaffee):
Avoid id="coordinates" in HTML ArticlePlaceholder output

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

Lucie added a comment.May 3 2016, 3:11 PM

For now I chose the cheap solution of just upper-casing the strings with "coordinates". Don't the nicest solution but maybe bearable for now.

Lucie moved this task from To Do Next to Review on the ArticlePlaceholder board.May 3 2016, 3:12 PM

Change 286664 merged by jenkins-bot:
Avoid id="coordinates" in HTML ArticlePlaceholder output

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

Lucie closed this task as Resolved.May 6 2016, 12:58 PM
Lucie moved this task from Review to Done on the ArticlePlaceholder board.