From 0bf4a6ca90ce1fdce1498860c0d450b46e881d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 21 Sep 2021 15:39:10 +0200 Subject: [PATCH] Use MediaWiki's new section edit summary if the user didn't modify it Bug: T275178 Change-Id: I5966cb5a523343f02ca955c27aa45822c29aab3f --- modules/NewTopicController.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/NewTopicController.js b/modules/NewTopicController.js index c78fd7dcc..2946725be 100644 --- a/modules/NewTopicController.js +++ b/modules/NewTopicController.js @@ -205,6 +205,13 @@ NewTopicController.prototype.getApiQuery = function ( comment, pageName, checkbo dttags: tags.join( ',' ) } ); + // Allow MediaWiki to generate the summary if it wasn't modified by the user. This avoids + // inconsistencies in how wiki markup is stripped from section titles when they're used in + // automatic summaries. (T275178) + if ( data.summary === this.generateSummary( this.sectionTitle.getValue() ) ) { + delete data.summary; + } + return data; };