aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-06-25 19:08:18 +0200
committerV <vendicated@riseup.net>2023-06-25 19:08:18 +0200
commit5e71ed286e714bb98daad44c1badc16cde4f45d9 (patch)
treecbda9d42006a4d53e1a2b62b695a7f00f778d125 /src
parent5edbd2391de69e302b90e335e057f35cc3ccc4e3 (diff)
downloadVencord-5e71ed286e714bb98daad44c1badc16cde4f45d9.tar.gz
Vencord-5e71ed286e714bb98daad44c1badc16cde4f45d9.tar.bz2
Vencord-5e71ed286e714bb98daad44c1badc16cde4f45d9.zip
PronounDB: Strip newlines from Discord Pronouns (Discord is stupid)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/pronoundb/pronoundbUtils.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/pronoundb/pronoundbUtils.ts b/src/plugins/pronoundb/pronoundbUtils.ts
index b6c4470..bded46b 100644
--- a/src/plugins/pronoundb/pronoundbUtils.ts
+++ b/src/plugins/pronoundb/pronoundbUtils.ts
@@ -86,8 +86,13 @@ export function useProfilePronouns(id: string, discordPronouns: string) {
}
+const NewLineRe = /\n+/g;
+
// Gets the cached pronouns, if you're too impatient for a promise!
export function getCachedPronouns(id: string, discordPronouns: string): string | null {
+ // Discord is so stupid you can put tons of newlines in pronouns
+ discordPronouns = discordPronouns?.trim().replace(NewLineRe, " ");
+
if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns)
return discordPronouns;