Skip to content

Commit 2f7fc31

Browse files
committed
gan-sorting: handle redirects to {{GA nominee}}
1 parent d0fb414 commit 2f7fc31

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

reports/gan-sorting.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const {populateWikidataShortdescs, normaliseShortdesc} = require('./commons');
6161
new: 0
6262
};
6363

64+
const GANTemplateNameRegex = /^GA ?(c(andidate)?|n(om(inee)?)?)$/i;
65+
6466
for await (let data of bot.massQueryGen({
6567
"action": "query",
6668
"prop": "revisions",
@@ -86,13 +88,13 @@ const {populateWikidataShortdescs, normaliseShortdesc} = require('./commons');
8688
let wkt = new bot.wikitext(text);
8789
let template = wkt.parseTemplates({
8890
count: 1,
89-
namePredicate: name => name === 'GA nominee'
91+
namePredicate: name => GANTemplateNameRegex.test(name)
9092
})[0];
9193

9294
if (!template) {
9395
template = wkt.parseTemplates({
9496
recursive: true
95-
}).find(t => t.name === 'GA nominee');
97+
}).find(t => GANTemplateNameRegex.test(t.name));
9698
}
9799
return template;
98100
};

0 commit comments

Comments
 (0)