Handle GoToSocial links

pull/165/head^2
Lim Chee Aun 2023-06-13 21:08:59 +08:00
rodzic 05d9cc59ea
commit db602147ab
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

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