Page MenuHomePhabricator

Anchors dropped from stub links
Closed, ResolvedPublic

Description

Author: sjorford

Description:
If you have stub display enabled, then links to stubs that include anchor links,
e.g. [[Foo#Bar]], render as a link to just [.../wiki/Foo]. With stub display
turned off, or for articles over the stub display threshold, is renders
correctly as [.../wiki/Foo#Bar]. See URL for example of [[February 29#Births]].
(I only noticed it because my stub threshold is set very high at the moment -
presumably there aren't many cases where one would need to link to a section of
a stub :)


Version: 1.7.x
Severity: normal
URL: http://en.wikipedia.org/wiki/Wikipedia:Categories_for_deletion/Log/2006_May_13#Category:Leap_day_births

Details

Reference
bz5959

Event Timeline

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

robchur wrote:

Links to stubs including an anchor show up fine for me using SVN trunk, r15139.
Let me check the details:

"Foo" is a stub containing a "links" section. I link to [[Foo]] and
[[Foo#Links]] from another page, and set the stub threshold to ~100. Both the
wiki links show up brown, etc.

Seems to be working...?

sjorford wrote:

It looks like the link text displays as "Foo#Links", but the actual link target
is still just "http://.../wiki/Foo". See test page at [[User:Sjorford/Test stub
links]].

(In reply to comment #0)

See URL for example of [[February 29#Births]]

This link contains a space, which is converted to %20 and then to an underscore:
my Mark 1 eyeball suggests that it is the latter conversion which drops the
anchor...

Does [[February_29#Births]] suffer from the same problem? (curses to the lack of
preview which means I have to ask rather than simply stating yeah or nay!)

(In reply to comment #3)

Does [[February_29#Births]] suffer from the same problem?

That would be a "no", although stupid IE refuses to actually jump to the anchor :-(

sjorford wrote:

(In reply to comment #3)

Does [[February_29#Births]] suffer from the same problem? (curses to the lack of
preview which means I have to ask rather than simply stating yeah or nay!)

Er...all the links work fine *here*, because this is Bugzilla, not MediaWiki -
or have I completely misunderstood what you're saying? On EN Wikipedia I still
get the problem with [[February 29#Births]], [[February_29#Births]], and
[[Lincoln#Culture]], using several skins and both IE and Firefox.

robchur wrote:

(In reply to comment #2)

It looks like the link text displays as "Foo#Links", but the actual link target
is still just "http://.../wiki/Foo". See test page at [[User:Sjorford/Test stub
links]].

Good lord, I must be going blind. Yes, confirmed.

Fixed in r21635

Linker::makeStubLinkObj had its own logic to handle links, it now
load the style and call Linker::makeKnownLinkObj.