Page MenuHomePhabricator

special character in sidebar leads to corrupt css
Closed, ResolvedPublic

Description

Author: m

Description:
Sidebar <li> - elements are getting an automatic id by the linktext.
But this provides corrupt id-name, if you use special character, according to css.

<li id="n-.C3.9Cbersicht"><a href="/index.php/%C3%9Cbersicht">Übersicht</a></li>

#n-.C3.9Cbersicht
and
#n-.Übersicht
can't accessed by css.

thx
klml


Version: unspecified
Severity: trivial

Details

Reference
bz18688

Event Timeline

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

happy.melon.wiki wrote:

Where is this issue apparent? Can you link to an example?

m wrote:

Where is this issue apparent?
Can you link to an example?

Sorry I got this problem in a extranet and made a workaround with "Uebersicht".

happy.melon.wiki wrote:

I mean can you be more specific about what you put where to get the effect: it sounds to me like you put a line

  • Übersicht | page-title

in [[MediaWiki:Sidebar]], and you fixed it by replacing the Ü with Ue. Is that right?

m wrote:

I mean can you be more specific about what you put where to get the effect: it sounds to me like you put a line

in wiktext I have:

  • Home|Home
  • Start|Start
  • Navigation|Navigation
  • Übersicht|Uebersicht
  • Übersicht|Übersicht
  • Staff|Staff

in html I have
<div class='pBody'>

<ul>
 <li id="n-Home"><a href="/index.php/Home">Home</a></li>
 <li id="n-Start"><a href="/index.php/Start">Start</a></li>
 <li id="n-Navigation"><a href="/index.php/Navigation">Navigation</a></li>
 <li id="n-Uebersicht"><a href="/index.php/%C3%9Cbersicht">Uebersicht</a></li>
 <li id="n-.C3.9Cbersicht"><a href="/index.php/%C3%9Cbersicht">Übersicht</a></li>
 <li id="n-Staff"><a href="/index.php/Staff">Staff</a></li>

I added the line '** Übersicht|Übersicht' just to reproduce the bug.

in [[MediaWiki:Sidebar]], and you fixed it by replacing the Ü with Ue. Is that right?

Yes

thx

Small tweak in r91932 to use the 'noninitial' mode on Sanitizer::escapeId(), since we prepend 'n-' to the beginning it doesn't need to worry about prepending something to make the initial char valid.