From d33281e7cc46052212d8de0dae0726590438499b Mon Sep 17 00:00:00 2001 From: Himanshu Soni Date: Mon, 23 Feb 2026 14:25:52 +0530 Subject: [PATCH] fix: resolve internal markdown link routing (#2267) --- components/StyledMarkdownBlock.tsx | 43 ++++++++++++++---------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/components/StyledMarkdownBlock.tsx b/components/StyledMarkdownBlock.tsx index eacebbf08..0d6f9a010 100644 --- a/components/StyledMarkdownBlock.tsx +++ b/components/StyledMarkdownBlock.tsx @@ -80,29 +80,26 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => { const combinedClassName = `${baseClassName} ${additionalClass}`.trim(); - const link = - href.charAt(0) === '/' ? ( - - {children} - - ) : ( - - {children} - - ); + const isInternal = href.startsWith('/') || href.startsWith('#'); + const link = isInternal ? ( + + {children} + + ) : ( + + {children} + + ); return <>{link}; },