Followup c232083: use getRelativeTitle for template titles

Otherwise we output stuff like {{Template:Echo|hello}}

Change-Id: Ib6c3996ab40e01a5ddce84b7daffa27a74020ee5
This commit is contained in:
Roan Kattouw 2014-11-10 15:03:10 -05:00
parent e611eaeb5f
commit 2ba844a372

View file

@ -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();