Fix matching bug with mastodon

This commit is contained in:
lanxu 2025-08-03 21:22:20 +03:00
parent 960e43ac9b
commit 5495549464

View File

@ -9,10 +9,10 @@ class Mastodon extends BasePlugin {
}
test(input) {
if (input.match(/http(s)?:\/\/(www\.)?((.*\..*\/users\/([a-zA-Z0-9_-]*)\/statuses\/([0-9_-]*)))/)) {
if (input.match(/http(s)?:\/\/(www\.)?((.*\..*\/users\/([a-zA-Z0-9_-]*)\/statuses\/([0-9_-]*)))$/)) {
return true
}
if (input.match(/http(s)?:\/\/(www\.)?(((.*\..*)\/@([a-zA-Z0-9_-]*)\/([0-9_-]*)))/)) {
if (input.match(/http(s)?:\/\/(www\.)?(((.*\..*)\/@([a-zA-Z0-9_-]*)\/([0-9_-]*)))$/)) {
return true
}
return false