From 3cbab3b78925604ee0af4dd110d93a1c1c335a23 Mon Sep 17 00:00:00 2001 From: Func Date: Wed, 19 Oct 2022 23:14:27 +0800 Subject: [PATCH] ReplyLinksController: Skip empty reply buttons container For preview parsing, the span containers are empty. Not sure why not strip the container along with all generated contents, but this should be the easiest fix. Bug: T321185 Change-Id: I9afb2d0f543b79dbac8a652236fe55284de542a8 --- modules/ReplyLinksController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ReplyLinksController.js b/modules/ReplyLinksController.js index 3e3d4fca2..66cf065b4 100644 --- a/modules/ReplyLinksController.js +++ b/modules/ReplyLinksController.js @@ -18,7 +18,7 @@ function ReplyLinksController( $pageContainer ) { this.onAnyLinkClickHandler = this.onAnyLinkClick.bind( this ); // Reply links - this.$replyLinkSets = $pageContainer.find( '.ext-discussiontools-init-replylink-buttons[data-mw-comment]' ); + this.$replyLinkSets = $pageContainer.find( '.ext-discussiontools-init-replylink-buttons[data-mw-comment]:not(:empty)' ); this.$replyLinkSets.each( function () { var replyButton = OO.ui.infuse( $( this ).find( '.ext-discussiontools-init-replybutton' ) );