Remove dup regex, add another GTS url pattern

pull/375/head
Lim Chee Aun 2023-12-28 15:42:27 +08:00
rodzic 437d721c26
commit 1765defa56
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -3,9 +3,8 @@ export default function isMastodonLinkMaybe(url) {
const { pathname, hash } = new URL(url);
return (
/^\/.*\/\d+$/i.test(pathname) ||
/^\/@[^/]+\/(statuses|posts)\/\w+\/?$/i.test(pathname) || // GoToSocial, Takahe
/^\/(@[^/]+|users\/[^/]+)\/(statuses|posts)\/\w+\/?$/i.test(pathname) || // GoToSocial, Takahe
/^\/notes\/[a-z0-9]+$/i.test(pathname) || // Misskey, Firefish
/^\/notes\/[a-z0-9]+$/i.test(pathname) || // Misskey, Calckey
/^\/(notice|objects)\/[a-z0-9-]+$/i.test(pathname) || // Pleroma
/#\/[^\/]+\.[^\/]+\/s\/.+/i.test(hash) // Phanpy 🫣
);