Resolve subpage links, and remove hack for H: titles

Change-Id: I6c9c64179274e5c1641a3b127ac3b273a3c5254e
This commit is contained in:
Gabriel Wicke 2012-05-24 17:57:41 +02:00
parent dc61f313a2
commit 6f62878c78

View file

@ -254,8 +254,12 @@ MWParserEnvironment.prototype.normalizeTitle = function( name ) {
* @fixme do this for real eh
*/
MWParserEnvironment.prototype.resolveTitle = function( name, namespace ) {
// hack! FIXME: match against proper list of namespaces
if ( ( name.indexOf(':') == -1 || name.match(/^H:/) ) && namespace ) {
// Resolve subpages
if ( name.length && name[0] === '/' ) {
name = this.normalizeTitle( this.pageName ) + name;
}
// FIXME: match against proper list of namespaces
if ( name.indexOf(':') == -1 && namespace ) {
// hack hack hack
name = namespace + ':' + this.normalizeTitle( name );
}