diff --git a/packages/docusaurus/src/client/exports/Link.tsx b/packages/docusaurus/src/client/exports/Link.tsx index c94727253aa0..a523eb4c88af 100644 --- a/packages/docusaurus/src/client/exports/Link.tsx +++ b/packages/docusaurus/src/client/exports/Link.tsx @@ -89,7 +89,7 @@ function Link({isNavLink, activeClassName, ...props}: Props): JSX.Element { const isAnchorLink = targetLink?.startsWith('#') ?? false; const isRegularHtmlLink = !targetLink || !isInternal || isAnchorLink; - if (isInternal && !isAnchorLink) { + if (targetLink && isInternal && !isAnchorLink) { if (targetLink && targetLink.startsWith('/http')) { console.log('collectLink', props); } @@ -99,7 +99,6 @@ function Link({isNavLink, activeClassName, ...props}: Props): JSX.Element { return isRegularHtmlLink ? ( // eslint-disable-next-line jsx-a11y/anchor-has-content