Skip to content

Commit

Permalink
Unfurl castopod links
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Feb 4, 2025
1 parent 4b0f523 commit a3fc396
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/isMastodonLinkMaybe.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ export default function isMastodonLinkMaybe(url) {
const { pathname, hash, hostname } = URL.parse(url);
return (
/^\/.*\/\d+$/i.test(pathname) ||
/^\/(@[^/]+|users\/[^/]+)\/(statuses|posts)\/\w+\/?$/i.test(pathname) || // GoToSocial, Takahe
/^\/(@[^/]+|users\/[^/]+)\/(statuses|posts)\/[\w-]+\/?$/i.test(
pathname,
) || // GoToSocial, Takahe, Castopod
/^\/notes\/[a-z0-9]+$/i.test(pathname) || // Misskey, Firefish
/^\/(notice|objects)\/[a-z0-9-]+$/i.test(pathname) || // Pleroma
/^\/@[^/]+\/post\/[a-z0-9\-_]+$/i.test(pathname) || // Threads
Expand Down

0 comments on commit a3fc396

Please sign in to comment.