1
0
Fork 0

Fix link detection

This commit is contained in:
Lim Chee Aun 2023-05-05 08:54:06 +08:00
parent 456d4f4ae8
commit d55bd95c72

View file

@ -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
);
}