From 6cb8d8d505372f12f8fad6d92b96a1d0bf4a9e57 Mon Sep 17 00:00:00 2001 From: NovemLinguae Date: Tue, 2 Jul 2024 21:17:37 -0700 Subject: [PATCH] MarkBlocked: filter outside the loop --- Gadget-markblocked.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Gadget-markblocked.js b/Gadget-markblocked.js index 04796d5..8ff81c4 100644 --- a/Gadget-markblocked.js +++ b/Gadget-markblocked.js @@ -66,7 +66,8 @@ Configuration variables: function markBlocked( $container ) { // Collect all the links in the page's content - const $contentLinks = $container.find( 'a' ); + const $contentLinks = $container.find( 'a' ) + .not( '.mw-changeslist-date, .ext-discussiontools-init-timestamplink, .mw-history-undo > a, .mw-rollback-link > a' ); // Get all aliases for user: & user_talk: const userNS = []; @@ -181,10 +182,6 @@ Configuration variables: $contentLinks.each( ( i, link ) => { const $link = $( link ); - if ( $link.is( '.mw-changeslist-date, .ext-discussiontools-init-timestamplink, .mw-history-undo > a, .mw-rollback-link > a' ) ) { - return; - } - const url = $link.attr( 'href' ); if ( !url ) { return;