mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 16:34:21 +00:00
Remove number when reading heading node
Bug: T264561 Change-Id: I0e6235f6b7169665e403fd6db1812fe90e8932b0
This commit is contained in:
parent
db328e3571
commit
eeefd985d6
|
@ -370,7 +370,7 @@ ReplyWidget.prototype.onModeTabSelectChoose = function ( option ) {
|
|||
* @return {ReplyWidget}
|
||||
*/
|
||||
ReplyWidget.prototype.setup = function ( data ) {
|
||||
var heading, summary, summaryPrefixLength;
|
||||
var heading, headingNode, summary, summaryPrefixLength;
|
||||
|
||||
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
|
||||
summary = '';
|
||||
} 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;
|
||||
summary += mw.msg( 'discussiontools-defaultsummary-reply' );
|
||||
|
|
Loading…
Reference in a new issue