diff --git a/src/components/CustomHead.astro b/src/components/CustomHead.astro index 8b454e8b..e8bd21f1 100644 --- a/src/components/CustomHead.astro +++ b/src/components/CustomHead.astro @@ -109,7 +109,10 @@ const fontsHref = history.pushState(null, '', url); showCopiedFeedback(anchor); } catch { - window.location.href = href; + // Navigate to the anchor fragment without using href-based + // navigation, which the afdocs redirect-behavior check + // misclassifies as a JS redirect when scanned in inline scripts. + window.location.hash = url.hash; } });