Improve converting to username from non-latin characters
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -8,8 +8,10 @@ function convertToUsername(value: string | null): string {
|
||||
.toLocaleLowerCase()
|
||||
.normalize("NFD")
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
.replace(/\s{2,}/, " ")
|
||||
.replace(/ /g, "_")
|
||||
.replace(/[^a-z0-9_]/g, "");
|
||||
.replace(/[^a-z0-9_]/g, "")
|
||||
.replace(/_{2,}/, "");
|
||||
}
|
||||
|
||||
function autoUpdateUsername(
|
||||
|
||||
Reference in New Issue
Block a user