From 6888df0c76bf5dd75db1b1dc6c9a91ecfbf59718 Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Mon, 1 Jun 2026 21:35:57 -0500 Subject: [PATCH] feat: enhance MDX link component with external link detection --- mdx-components.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mdx-components.tsx b/mdx-components.tsx index 3899668..a60028e 100644 --- a/mdx-components.tsx +++ b/mdx-components.tsx @@ -30,11 +30,20 @@ export function useMDXComponents(components: MDXComponents): MDXComponents { ), hr: () =>
, - a: ({ href, children }) => ( - - {children} - - ), + a: ({ href, children, ...props }) => { + const isExternal = typeof href === 'string' && (href.startsWith('http://') || href.startsWith('https://')) + return ( + + {children} + + ) + }, code: ({ children, ...props }) => (