Skip to content

Commit

Permalink
MarkBlocked: filter outside the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Jul 3, 2024
1 parent 92b6ac1 commit 6cb8d8d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Gadget-markblocked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6cb8d8d

Please sign in to comment.