Merge "Fix skipping past our own reply buttons for wrapped comments"

This commit is contained in:
jenkins-bot 2021-01-19 15:14:53 +00:00 committed by Gerrit Code Review
commit 234198d9b1

View file

@ -91,11 +91,6 @@ function addListItem( comment ) {
desiredLevel = comment.level + 1;
target = curComment.range.endContainer;
// HACK: Skip past our own reply buttons
if ( target.nextSibling && target.nextSibling.className && target.nextSibling.className.indexOf( 'dt-init-replylink-buttons' ) !== -1 ) {
target = target.nextSibling;
}
// target is a text node or an inline element at the end of a "paragraph" (not necessarily paragraph node).
// First, we need to find a block-level parent that we can mess with.
// If we can't find a surrounding list item or paragraph (e.g. maybe we're inside a table cell
@ -107,6 +102,11 @@ function addListItem( comment ) {
// parent is a list item or paragraph (hopefully)
// target is an inline node within it
// HACK: Skip past our own reply buttons
if ( target.nextSibling && target.nextSibling.className && target.nextSibling.className.indexOf( 'dt-init-replylink-buttons' ) !== -1 ) {
target = target.nextSibling;
}
// Instead of just using curComment.level, consider indentation of lists within the
// comment (T252702)
curLevel = utils.getIndentLevel( target, curComment.rootNode ) + 1;