mirror of
https://github.com/ItsVipra/ProToots
synced 2024-11-22 11:33:03 +00:00
Add any/all pronouns special case
This commit is contained in:
parent
431dcd4bc6
commit
f51b2e71fe
2 changed files with 6 additions and 0 deletions
|
@ -227,6 +227,10 @@ function extractFromBio(bio) {
|
||||||
for (const match of followedByColon) {
|
for (const match of followedByColon) {
|
||||||
return match.pop(); // first group is last entry in array
|
return match.pop(); // first group is last entry in array
|
||||||
}
|
}
|
||||||
|
const anyAllPronouns = bio.match(/(any|all) +pronouns/gi);
|
||||||
|
if (anyAllPronouns) {
|
||||||
|
return anyAllPronouns[0];
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,8 @@ const bioExtractTests = [
|
||||||
["pronouns: uwu/owo", "uwu/owo"], // followed by pronoun pattern
|
["pronouns: uwu/owo", "uwu/owo"], // followed by pronoun pattern
|
||||||
["pronouns: any", "any"], // followed by pronoun pattern
|
["pronouns: any", "any"], // followed by pronoun pattern
|
||||||
["I'm cute af (she / they)", "she/they"], // with whitespace between pronouns
|
["I'm cute af (she / they)", "she/they"], // with whitespace between pronouns
|
||||||
|
["pronouns: any/all", "any/all"], // any pronouns
|
||||||
|
["any pronouns", "any pronouns"], // any pronouns
|
||||||
];
|
];
|
||||||
for (const [input, expects] of bioExtractTests) {
|
for (const [input, expects] of bioExtractTests) {
|
||||||
bioExtractSuite(input, async () => {
|
bioExtractSuite(input, async () => {
|
||||||
|
|
Loading…
Reference in a new issue