mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Resolve subpage links, and remove hack for H: titles
Change-Id: I6c9c64179274e5c1641a3b127ac3b273a3c5254e
This commit is contained in:
parent
dc61f313a2
commit
6f62878c78
|
@ -254,8 +254,12 @@ MWParserEnvironment.prototype.normalizeTitle = function( name ) {
|
||||||
* @fixme do this for real eh
|
* @fixme do this for real eh
|
||||||
*/
|
*/
|
||||||
MWParserEnvironment.prototype.resolveTitle = function( name, namespace ) {
|
MWParserEnvironment.prototype.resolveTitle = function( name, namespace ) {
|
||||||
// hack! FIXME: match against proper list of namespaces
|
// Resolve subpages
|
||||||
if ( ( name.indexOf(':') == -1 || name.match(/^H:/) ) && namespace ) {
|
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
|
// hack hack hack
|
||||||
name = namespace + ':' + this.normalizeTitle( name );
|
name = namespace + ':' + this.normalizeTitle( name );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue