Page MenuHomePhabricator

If a section title on a talk page is '_' (underscore), it is shown instead of any other sections on mobile web
Closed, DuplicatePublic

Description

On my user talk page in the English Wikpedia there is a section with the title == _ == - just an underscore. It's several years old.

When I receive an Echo notification about new messages on my user talk page on mobile web and I tap it, this "_" section is always shown, even though the notification is about much newer sections.

Sorry about overtagging: I'm not sure in which project the problem is. Remove the unnecessary tags. Thanks.

Event Timeline

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

PHP parser output for that heading:

<h2><span class="mw-headline" id="">_</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=User_talk:Amire80&amp;action=edit&amp;section=6" title="Edit section: ">edit source</a><span class="mw-editsection-bracket">]</span></span></h2>

The id="" is probably causing trouble.

Trying to make a link to that section results in https://en.wikipedia.org/wiki/User:Amire80#, which is equivalent to https://en.wikipedia.org/wiki/User:Amire80. Web browsers on desktop ignore the empty fragment, and do not scroll to the section. I assume MobileFrontend doesn't ignore it, and so it tries to show that section on every normal page view.

Empty id is also a HTML spec violation: https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute "When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element's tree and must contain at least one character."

Parsoid does not generate that, it instead has an auto-generated id.