Skip to content

Commit

Permalink
Merge pull request #291 from gagahpangeran/fix-markdown-external-link
Browse files Browse the repository at this point in the history
Fix markdown external link
  • Loading branch information
gagahpangeran authored Feb 21, 2025
2 parents 5b8176b + cf2bfdd commit 2216737
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/PostMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ export default function PostMarkdown({ children, slug }: Props) {
}

if (url.startsWith("http")) {
<a href={url} target="_blank" rel="nofollow noopener noreferrer">
{props.children}
</a>;
return (
<a href={url} target="_blank" rel="nofollow noopener noreferrer">
{props.children}
</a>
);
}

return <a href={url}>{props.children}</a>;
Expand Down

0 comments on commit 2216737

Please sign in to comment.