Fix link detection

pull/122/head
Lim Chee Aun 2023-05-05 08:54:06 +08:00
rodzic 456d4f4ae8
commit d55bd95c72
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
export default function isMastodonLinkMaybe(url) {
const { pathname } = new URL(url);
return (
/^https:\/\/.*\/\d+$/i.test(url) ||
/^https:\/\/.*\/notes\/[a-z0-9]+$/i.test(url) // Misskey, Calckey
/^\/.*\/\d+$/i.test(pathname) || /^\/notes\/[a-z0-9]+$/i.test(pathname) // Misskey, Calckey
);
}