From b1aebf0b48c5bc7b8b072f919e3a86b70a8a9ae3 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Fri, 25 Mar 2016 04:43:41 +0000 Subject: [PATCH] Don't strip namespace from text that we replace firstHeading with wgTitle is basically just $title->getText() wgPageName is $title->getPrefixedDBkey() So we need to take wgPageName and run getPrefixedText (difference is underscores get replaced by spaces) Change-Id: Ib99f0d20f1ba99338f80bbbf39cffd544887c3fa --- modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index d3c04ea157..7508482317 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -297,7 +297,9 @@ ve.init.mw.DesktopArticleTarget.prototype.loadSuccess = function ( response ) { this.checkboxesByName = {}; this.$otherFields = $( [] ); if ( [ 'edit', 'submit' ].indexOf( mw.util.getParamValue( 'action' ) ) !== -1 ) { - $( '#content #firstHeading' ).text( mw.config.get( 'wgTitle' ) ); + $( '#content #firstHeading' ).text( + mw.Title.newFromText( mw.config.get( 'wgPageName' ) ).getPrefixedText() + ); } if ( data.checkboxes ) {