mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
InternalLink: Add special case for fragment with no title
Bug: T218581 Change-Id: I11e2de90e582d184a3f8cdd65dfc0858571aa397
This commit is contained in:
parent
2fc64107f4
commit
dbd692b5ed
|
@ -173,6 +173,12 @@ ve.dm.MWInternalLinkAnnotation.static.getHref = function ( dataElement ) {
|
|||
}
|
||||
} ).join( '' );
|
||||
}
|
||||
if ( encodedTitle.slice( 0, 1 ) === '#' ) {
|
||||
// Special case: For a newly created link to a #fragment with
|
||||
// no explicit title use the current title as prefix (T218581)
|
||||
// TODO: Pass a 'doc' param to getPageName
|
||||
encodedTitle = ve.init.target.getPageName() + encodedTitle;
|
||||
}
|
||||
return './' + encodedTitle;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue