From db860a819e95bc99e0a502d4c5c1d72813e49e07 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 17 May 2024 19:42:13 +0200 Subject: [PATCH] Add hack comment --- packages/docusaurus/src/client/exports/Link.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus/src/client/exports/Link.tsx b/packages/docusaurus/src/client/exports/Link.tsx index 0fe7360b97..08901b9bd4 100644 --- a/packages/docusaurus/src/client/exports/Link.tsx +++ b/packages/docusaurus/src/client/exports/Link.tsx @@ -81,7 +81,11 @@ function Link( ? maybeAddBaseUrl(targetLinkWithoutPathnameProtocol) : undefined; - // TODO temporary hack + // TODO find a way to solve this problem properly + // Fix edge case when useBaseUrl is used on a link + // "./" is useful for images and other resources + // But we don't need it for + // unfortunately we can't really make the difference :/ if (router === 'hash' && targetLink?.startsWith('./')) { targetLink = targetLink?.slice(1); }