Hi,
some time ago I asked whether we should start using the MediaWiki namespace for bars of links that recur on several articles; take, for example, the list of links at the bottom of each Greek letter (http://en.wikipedia.org/wiki/Beta).
As far as I remember, it was said that the problem would be that we would get a large number of self-links.
My suggestion to solve that problem was to have {{msg:}} automatically change [[blahblah]] to '''blahblah''' when it is inserted into the page "blahblah".
I have attempted to code this, and I came up with the following. This patch has the side-effect of changing all self-links to bold text, even when they're not inserted using {{msg:}}.
I've tested this on "normal" self-links, and it appears to be working fine. I can't test it with stuff inserted with {{msg:}} because the MediaWiki stuff doesn't seem to work for me (see Message-ID: bverjf$meb$1@sea.gmane.org - any help appreciated :/).
Thanks, Timwi
Index: phase3/includes/OutputPage.php =================================================================== RCS file: /cvsroot/wikipedia/phase3/includes/OutputPage.php,v retrieving revision 1.79 diff -u -r1.79 OutputPage.php --- phase3/includes/OutputPage.php 30 Jan 2004 17:07:50 -0000 1.79 +++ phase3/includes/OutputPage.php 30 Jan 2004 23:57:02 -0000 @@ -1054,6 +1054,10 @@ $s .= $sk->makeLink( $link, $text, "", $trail ); */ } + if( $nt->getPrefixedText() == $wgTitle->getPrefixedText() ) { + $s .= "<strong>" . $text . "</strong>" . $trail; + continue; + } if( $ns == $media ) { $s .= $sk->makeMediaLinkObj( $nt, $text ) . $trail; $wgLinkCache->addImageLinkObj( $nt );