mediawiki.jqueryMsg: Strip leading colon in wikilinks
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.jqueryMsg.js
index 7dd9ade..8957430 100644 (file)
                        var page, anchor, url, $el;
 
                        page = textify( nodes[ 0 ] );
+                       // Strip leading ':', which is used to suppress special behavior in wikitext links,
+                       // e.g. [[:Category:Foo]] or [[:File:Foo.jpg]]
+                       if ( page.charAt( 0 ) === ':' ) {
+                               page = page.slice( 1 );
+                       }
                        url = mw.util.getUrl( page );
 
                        if ( nodes.length === 1 ) {