Handle GoToSocial links

This commit is contained in:
Lim Chee Aun 2023-06-13 21:08:59 +08:00
parent 05d9cc59ea
commit db602147ab

View file

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