mirror of
https://github.com/ItsVipra/ProToots
synced 2024-11-28 22:40:17 +00:00
Return null if the sanitization would be empty
This commit is contained in:
parent
6e4f0d4969
commit
b9fbb9b204
1 changed files with 4 additions and 1 deletions
|
@ -136,7 +136,10 @@ function sanitizePronouns(str) {
|
|||
str = str.replace(/:[\w_]+:/gi, "");
|
||||
|
||||
// Finally, remove leading and trailing whitespace.
|
||||
return str.trim();
|
||||
str= str.trim();
|
||||
|
||||
// If the result is empty, return null, otherwise the empty string.
|
||||
return str==="" ? null : str;
|
||||
}
|
||||
|
||||
const knownPronouns = [
|
||||
|
|
Loading…
Reference in a new issue