Page MenuHomePhabricator

href="" is not OK for a dummy link
Closed, InvalidPublic

Description

Author: giecrilj

Description:
href="" means that you want to see the current index, and even then it is better to say href=".".

The message text should be:

Format broken links <a href="#" class="new">like this</a> (alternative: like this<a href="#" class="internal">?</a>)


Version: unspecified
Severity: trivial
URL: http://www.mediawiki.org/wiki/MediaWiki:Tog-highlightbroken

Details

Reference
bz26133

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:22 PM
bzimport set Reference to bz26133.
bzimport added a subscriber: Unknown Object (MLST).

note: I am sure "#" will send you to the top of the document in some "old?" browsers.

Do we even need to have that message as a proper link? couldn't we just fudge it with some css?

will send you to the top (especially in Firefox for instance)

In the preferences this is a bit dangerous, especially in skins with non-tabbed preferences.

We could use the preferences JS, to hook the links and cancel their events of course....

@p858snake. Fudging it with CSS wouldn't be skin independent.

giecrilj wrote:

And why is sending to the top worse than sending to the index?

How about:

Format broken links <a id="org.wikimedia.MediaWiki.fakelink.1" href="#org.wikimedia.MediaWiki.fakelink.1" class="new">like this</a> (alternative: like
this <a id="org.wikimedia.MediaWiki.fakelink.2" href="#org.wikimedia.MediaWiki.fakelink.2" class="internal">?</a>)

That will cause the page to akwardly scroll down untill that link is at the top of the window, which is not the expected behaviour.

If one wans't to make the link jump to itself use #mw-input-highlightbroken which is the nearest ID.

I suggest using href="#", which doesn't refresh/leave the page in any browser. In most modern browsers it does nothing, and in (some) Mozilla browsers it scrols back to the top (big deal).

To finish the deal onclick="return false;" ?

giecrilj wrote:

To finish the deal. disable the click event.

onclick is discouraged, and it is likely to be deprecated; handlers should be set within the JS UI controller framework. Of couse, the exact code to use depends on the controller used.

Please do not take that remark as an insult; I am sure your recipe was meant to be pseudocode.

Why not just <a class="new">like this</a>

giecrilj wrote:

Because that would not work in browsers that do not support CSS.

BTW, it should also say rel=nofollow.

Preference 'highlightbroken' was removed