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
This commit is contained in:
David Lynch 2017-03-21 10:56:03 -05:00
parent 1adedfbd8b
commit 1dc18b6703

View file

@ -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 ) {