From 1ec2dd0bdffa3e764f20b8f0294649fd6ad97ab6 Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Mon, 9 Sep 2024 10:57:37 +0800 Subject: [PATCH] fix(github activity): only replace relative link (#16667) --- lib/routes/github/activity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/github/activity.ts b/lib/routes/github/activity.ts index 33b255cc0..658567fb1 100644 --- a/lib/routes/github/activity.ts +++ b/lib/routes/github/activity.ts @@ -45,7 +45,7 @@ export const route: Route = { item: feed.items.map((item) => ({ title: item.title ?? '', link: item.link, - description: sanitizeHtml(item.content?.replace(/href="(.+?)"/g, `href="https://github.com$1"`) ?? '', { allowedTags: [...sanitizeHtml.defaults.allowedTags, 'img'] }), + description: sanitizeHtml(item.content?.replace(/href="\/(.+?)"/g, `href="https://github.com/$1"`) ?? '', { allowedTags: [...sanitizeHtml.defaults.allowedTags, 'img'] }), pubDate: item.pubDate ? parseDate(item.pubDate) : undefined, author: item.author, guid: item.id,