fix(github activity): only replace relative link (#16667)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user