From 1dc18b6703253f362a9b037b317d16c5837b0faf Mon Sep 17 00:00:00 2001 From: David Lynch Date: Tue, 21 Mar 2017 10:56:03 -0500 Subject: [PATCH] Section editing: strip links from heading text used for edit summary Stops us including "[edit]" in the summary when people have marked whole headings for translation. Bug: T160911 Change-Id: I906398e6bf45433d904795847f59b5bf0148092f --- modules/ve-mw/init/ve.init.mw.ArticleTarget.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index a9e718ca48..d9394ba36f 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -2028,7 +2028,9 @@ ve.init.mw.ArticleTarget.prototype.restoreEditSection = function () { headingNode = $section.data( 'view' ); if ( $section.length && new mw.Uri().query.summary === undefined ) { - headingText = $section.text(); + // Due to interactions with Translate, strip out mw- + // editsection from the heading. + headingText = $section.clone().find( 'span.mw-editsection' ).remove().end().text(); } if ( headingNode ) {