From a3fc39673888362ebdf5dc91481bba5b4768cdb9 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 4 Feb 2025 17:22:05 +0800 Subject: [PATCH] Unfurl castopod links --- src/utils/isMastodonLinkMaybe.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/isMastodonLinkMaybe.js b/src/utils/isMastodonLinkMaybe.js index 1e749e3d..780585c4 100644 --- a/src/utils/isMastodonLinkMaybe.js +++ b/src/utils/isMastodonLinkMaybe.js @@ -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