Page MenuHomePhabricator

Language headers with flags don't work
Open, Needs TriagePublicBUG REPORT


Steps to replicate the issue (include links if applicable):

What happens?:
No flags when there should at least be one:

Bug.PNG (1×1 px, 106 KB)

What should have happened instead?:

Norm.PNG (1×1 px, 100 KB)

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
I noticed that this also doesn't work with Tabbed languages, but that isn't a Parsoid problem. If that is a feature and not a bug, then someone should say that in the gadget description.
I'm sorry if this was irrelevant/already known and I may have wasted your time.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This is a result of a slight change in the HTML structure of headings. Previously, they looked like this:

    <span class="mw-headline" id="Italian">Italian</span>
    <span class="mw-editsection">...</span>

whereas Parsoid renders them as:

<div class="mw-heading mw-heading2" id="mwEA">
    <h2 id="Italian">Italian</h2>
    <span class="mw-editsection" id="mwEQ">...</span>

The CSS selectors that the gadget uses (at look like .ns-0 h2 #Italian::before, and so match the old-style headings but not the new ones.

This task may be worthwhile as "this is the sort of gadget that heading style changes will break", but the best fix would be to adjust the gadget by adding other selectors, so .ns-0 h2 #Italian::before becomes .ns-0 h2 #Italian::before, .ns-0 h2#Italian::before, which works on both Parsoid and non-Parsoid HTML. I updated the script that generates the gadget source; all that's needed now is for an enwiktionary intadmin to re-run the generating script.