Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: ignore all dashes in anchor matching

Francesco Sansalvadore860de1f43d02
diff --git a/apps/www/hooks/useActiveAnchors.tsx b/apps/www/hooks/useActiveAnchors.tsx
index 9ef2a5309e0..8dd569c6f5f 100644
--- a/apps/www/hooks/useActiveAnchors.tsx
+++ b/apps/www/hooks/useActiveAnchors.tsx
@@ -28,8 +28,8 @@ const useActiveAnchors = (
// to make toc hrefs and content headings ids match
const sanitizedHref = stripEmojis(
decodeURI(link.getAttribute('href') ?? '').replace('#', '')
- ).replace('--', '-')
- const isMatch = sanitizedHref === newActiveAnchor
+ ).replaceAll('-', '')
+ const isMatch = sanitizedHref === newActiveAnchor.replaceAll('-', '')
if (isMatch) {
link.classList.add('toc-animate')