fix(feed post): remove www in links

This commit is contained in:
plebeius.eth
2023-10-16 20:42:28 +02:00
parent 0fd9fbb845
commit 04b6fc2bb5

View File

@@ -125,7 +125,7 @@ const FeedPost: FC<FeedPostProps> = ({ post, index }) => {
<a href={link} target='_blank' rel='noreferrer'>
{(() => {
try {
return new URL(link).hostname;
return new URL(link).hostname.replace(/^www\./, '') ;
} catch (e) {
return 'Invalid URL';
}