From 29db91edbf6b8371febf4fbf44ac947107cc8cd3 Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Mon, 13 May 2024 17:16:41 +0000 Subject: [PATCH] feat(site): open README links in new tab --- site/src/components/Markdown/Markdown.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/site/src/components/Markdown/Markdown.tsx b/site/src/components/Markdown/Markdown.tsx index d06d2eca7a653..228cd241ccece 100644 --- a/site/src/components/Markdown/Markdown.tsx +++ b/site/src/components/Markdown/Markdown.tsx @@ -37,11 +37,15 @@ export const Markdown: FC = (props) => { className={className} remarkPlugins={[gfm]} components={{ - a: ({ href, target, children }) => ( - - {children} - - ), + a: ({ href, children }) => { + const isExternal = href?.startsWith("http"); + + return ( + + {children} + + ); + }, pre: ({ node, children }) => { if (!node || !node.children) {