Skip to content

Commit

Permalink
Fix relative URLs comment link preview (aeharding#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Aug 2, 2024
1 parent b953d68 commit 204af2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/features/comment/CommentLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export default function CommentLinks({ markdown }: CommentLinksProps) {
if (node.type === "link" || (!showCommentImages && node.type === "image"))
links.push({
type: node.type,
url: node.url,
// normalize relative links
url: new URL(node.url, `https://${connectedInstance}`).href,
text:
"children" in node ? (node.children[0] as Text)?.value : undefined,
});
Expand Down

0 comments on commit 204af2d

Please sign in to comment.