Page MenuHomePhabricator

Blank anchor [[#|anchor link]] should not link to the Main Page
Closed, ResolvedPublic

Description

Blank anchor anchor link becomes non-blank <a href="/wiki/">anchor link</a> when it should become <a href="#">anchor link</a>

Demo:

https://www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=477242

Also occurs in the 1.18wmf branch. My plain 1.18 works correctly only because JavaScript is usurping the link, probably because of this bug (feature?!):

https://bugzilla.wikimedia.org/show_bug.cgi?id=28344

Demo (login with Demo/test):

http://www.coincompendium.com/w/index.php/CCT405


Version: 1.18.x
Severity: normal

Details

Reference
bz33437

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:03 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz33437.
bzimport added a subscriber: Unknown Object (MLST).

The bug is in your 1.18.0 just like it is on mediawiki.org; JavaScript can hijack the mouse clicking action, which is what we do in the jQuery.makeCollapsible plugin, but that doesn't have a connection to this bug.

I should have rephrase to say that it SEEMS to work correctly, even though it actually isn't.

OK, I think I may have found a related bug, but I'm not sure how to test it any further. A blank anchor link will show up as black and bolded, with no normal link styling at all, when it appears on any of the Semantic Forms special pages. I'm not sure if it's a problem with Semantic Forms, or special pages in general because I don't know how to edit and test some ordinary special pages.

Advice?

Are special pages wiki links parsed differently from other namespaces?

It looks like it is also being hard-coded with bolding that can't be overridden with inline styling.

Nevermind about the bolding, etc. Since the anchor link is to the page the user is on, it is displayed as bold text instead of a link. That is normal behavior. I just didn't realize what was happening.

Will bug 30327 be solved when this bug is fixed?

The link behavior will exactly match all other links on a wiki, once this bug is fixed. Bug 30327 complains about this:

"When the pointer is hovered...the cursor takes the form of an up-and-down arrow rather than the pointing-index-finger form".

And that will be corrected when this bug is fixed, because then you will just use Your link text here to produce links, and the link will work exactly like all other links, with the pointing-index-finger form - if that's the default that your browser and your wiki uses, as is normally the case.

Of course, pointers can still be customized on the site itself using CSS or JavaScript, or by the user within the browser, once this bug is fixed. This bug shows a starting point for a temporary workaround:

https://bugzilla.wikimedia.org/show_bug.cgi?id=33432

If you want your collapse/expand toggles to appear like normal (Vector skin) links, put the following CSS in your MediaWiki:Common.css:

/* For mw-collapsible toggles to make them look like regular links */
/* :visited, :hover, and :active pseudoclasses must always be in that order! */
.pseudolink { cursor:pointer; color:#0645AD; }
.pseudolink:visited { color:#0B0080; }
.pseudolink:hover { text-decoration:underline; }
.pseudolink:active { color:#faa700; }

You can change those CSS parameters to suit your needs. Note that the ":visited" parameter does not work with MakeCollapsible toggles because you're not visiting anything when you click them, so your links will always look like fresh, unclicked links. But, you can used that class for other things on your site, so I included it for completeness.

I forgot to add that, in order to use that workaround CSS code, you need to style your toggle text like this:

<span class="pseudolink">Your toggle text</span>

  • Bug 38103 has been marked as a duplicate of this bug. ***
  • This bug has been marked as a duplicate of bug 17006 ***