mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-28 10:11:45 +00:00
Merge "Remove number when reading heading node"
This commit is contained in:
commit
6d5b41ad2c
|
@ -370,7 +370,7 @@ ReplyWidget.prototype.onModeTabSelectChoose = function ( option ) {
|
||||||
* @return {ReplyWidget}
|
* @return {ReplyWidget}
|
||||||
*/
|
*/
|
||||||
ReplyWidget.prototype.setup = function ( data ) {
|
ReplyWidget.prototype.setup = function ( data ) {
|
||||||
var heading, summary, summaryPrefixLength;
|
var heading, headingNode, summary, summaryPrefixLength;
|
||||||
|
|
||||||
data = data || {};
|
data = data || {};
|
||||||
|
|
||||||
|
@ -388,7 +388,10 @@ ReplyWidget.prototype.setup = function ( data ) {
|
||||||
// This comment is in 0th section, there's no section title for the edit summary
|
// This comment is in 0th section, there's no section title for the edit summary
|
||||||
summary = '';
|
summary = '';
|
||||||
} else {
|
} else {
|
||||||
summary = '/* ' + heading.range.startContainer.querySelector( '.mw-headline' ).innerText + ' */ ';
|
headingNode = heading.range.startContainer.querySelector( '.mw-headline' ).cloneNode( true );
|
||||||
|
// Remove mw-headline-number. T264561
|
||||||
|
$( headingNode ).find( '.mw-headline-number' ).remove();
|
||||||
|
summary = '/* ' + headingNode.innerText.trim() + ' */ ';
|
||||||
}
|
}
|
||||||
summaryPrefixLength = summary.length;
|
summaryPrefixLength = summary.length;
|
||||||
summary += mw.msg( 'discussiontools-defaultsummary-reply' );
|
summary += mw.msg( 'discussiontools-defaultsummary-reply' );
|
||||||
|
|
Loading…
Reference in a new issue