mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Followup c232083
: use getRelativeTitle for template titles
Otherwise we output stuff like {{Template:Echo|hello}} Change-Id: Ib6c3996ab40e01a5ddce84b7daffa27a74020ee5
This commit is contained in:
parent
e611eaeb5f
commit
2ba844a372
|
@ -85,12 +85,13 @@ ve.dm.MWTemplateModel.newFromData = function ( transclusion, data ) {
|
|||
* @returns {ve.dm.MWTemplateModel|null} New template model
|
||||
*/
|
||||
ve.dm.MWTemplateModel.newFromName = function ( transclusion, name ) {
|
||||
var href, title;
|
||||
var href, title,
|
||||
templateNs = mw.config.get( 'wgNamespaceIds' ).template;
|
||||
if ( name instanceof mw.Title ) {
|
||||
title = name;
|
||||
name = title.getPrefixedText();
|
||||
name = title.getRelativeText( templateNs );
|
||||
} else {
|
||||
title = mw.Title.newFromText( name, mw.config.get( 'wgNamespaceIds' ).template );
|
||||
title = mw.Title.newFromText( name, templateNs );
|
||||
}
|
||||
if ( title !== null ) {
|
||||
href = title.getPrefixedText();
|
||||
|
|
Loading…
Reference in a new issue