feat(site): open README links in new tab (#13264)

This commit is contained in:
Bruno Quaresma
2024-05-13 15:11:01 -03:00
committed by GitHub
parent 8412450ae3
commit a5a64948cd
+9 -5
View File
@@ -37,11 +37,15 @@ export const Markdown: FC<MarkdownProps> = (props) => {
className={className}
remarkPlugins={[gfm]}
components={{
a: ({ href, target, children }) => (
<Link href={href} target={target}>
{children}
</Link>
),
a: ({ href, children }) => {
const isExternal = href?.startsWith("http");
return (
<Link href={href} target={isExternal ? "_blank" : undefined}>
{children}
</Link>
);
},
pre: ({ node, children }) => {
if (!node || !node.children) {