Skip to content

Commit

Permalink
Update src/groups/zh/checkuser/MediaWiki:Group-checkuser.js
Browse files Browse the repository at this point in the history
Co-authored-by: AnnAngela <[email protected]>
  • Loading branch information
lovelyCARDINAL and AnnAngela authored Oct 28, 2023
1 parent c3b5c6e commit 29e6ffb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/groups/zh/checkuser/MediaWiki:Group-checkuser.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,14 @@
}
const nextSection = h3s[nextIndex];

const userlist = (() => {
const result = [];
for (let ele = section.nextElementSibling; ele && ele !== nextSection; ele = ele.nextElementSibling) {
const elements = ele.querySelectorAll("li > a");
const usernames = Array.from(elements)
.map((a) => a.textContent.trim())
.filter((text) => text.match(/^user:/i));
result.push(...usernames);
}
return result;
})();
const userlist =
for (let ele = section.nextElementSibling; ele && ele !== nextSection; ele = ele.nextElementSibling) {
const elements = ele.querySelectorAll("li > a");
const usernames = Array.from(elements)
.map((a) => a.textContent.trim())
.filter((text) => text.match(/^user:/i));
userlist.push(...usernames);
}

const $bar = $(section.getElementsByClassName("mw-editsection")[0]);
const $divider = $('<span class="mw-editsection-divider"> | </span>');
Expand Down

0 comments on commit 29e6ffb

Please sign in to comment.