mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Correctly handle underscores when parsing usernames
This commit is contained in:
parent
bbfd26bb64
commit
bd1f09837b
|
|
@ -84,7 +84,7 @@ export const emojiValidatorWithIdentifiers = createRegExp(
|
|||
|
||||
export const mentionValidator = createRegExp(
|
||||
exactly("@"),
|
||||
oneOrMore(anyOf(letter.lowercase, digit, charIn("-"))).groupedAs(
|
||||
oneOrMore(anyOf(letter.lowercase, digit, charIn("-_"))).groupedAs(
|
||||
"username",
|
||||
),
|
||||
maybe(
|
||||
|
|
@ -96,7 +96,7 @@ export const mentionValidator = createRegExp(
|
|||
|
||||
export const userAddressValidator = createRegExp(
|
||||
maybe("@"),
|
||||
oneOrMore(anyOf(letter.lowercase, digit, charIn("-"))).groupedAs(
|
||||
oneOrMore(anyOf(letter.lowercase, digit, charIn("-_"))).groupedAs(
|
||||
"username",
|
||||
),
|
||||
maybe(
|
||||
|
|
@ -108,7 +108,7 @@ export const userAddressValidator = createRegExp(
|
|||
|
||||
export const webfingerMention = createRegExp(
|
||||
exactly("acct:"),
|
||||
oneOrMore(anyOf(letter, digit, charIn("-"))).groupedAs("username"),
|
||||
oneOrMore(anyOf(letter, digit, charIn("-_"))).groupedAs("username"),
|
||||
maybe(
|
||||
exactly("@"),
|
||||
oneOrMore(anyOf(letter, digit, charIn("_-.:"))).groupedAs("domain"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue