1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-26 16:55:09 +01:00

feat(ActionExtension): Use same Regex for Username matching as in App

This commit is contained in:
Marcus Kida 2023-01-12 10:11:11 +01:00
parent 1121cdd80b
commit fde4c14b49
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40

View File

@ -30,7 +30,7 @@ Action.prototype = {
}; };
function detectUsername() { function detectUsername() {
var uriUsername = document.documentURI.match("@(.+)@([a-z0-9]+\.[a-z0-9]+)") var uriUsername = document.documentURI.match("(?:@([a-zA-Z0-9_]+)(@[a-zA-Z0-9_.-]+)?|#([^\\s.]+))")
if (Array.isArray(uriUsername)) { if (Array.isArray(uriUsername)) {
return uriUsername[0] return uriUsername[0]