From 281d0067a57bdd71c703464377281115df4a3439 Mon Sep 17 00:00:00 2001 From: shrey Date: Thu, 9 Jan 2025 18:29:56 +0530 Subject: [PATCH 1/5] fix: table of contents links not working --- components/TOC.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/TOC.tsx b/components/TOC.tsx index f51acadc0fef..696f297768c5 100644 --- a/components/TOC.tsx +++ b/components/TOC.tsx @@ -75,7 +75,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe
item.slug)} + items={tocItems.map((item) => item.slugWithATag)} currentClassName='text-primary-500 font-bold' componentTag='div' rootEl={contentSelector} @@ -85,7 +85,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe From 4ad7f87a3353514318338a8df5d7c83c1f2f2b88 Mon Sep 17 00:00:00 2001 From: shrey Date: Fri, 10 Jan 2025 01:28:14 +0530 Subject: [PATCH 2/5] fix: table of contents links not working --- components/TOC.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/TOC.tsx b/components/TOC.tsx index 696f297768c5..4c1ed890a28c 100644 --- a/components/TOC.tsx +++ b/components/TOC.tsx @@ -75,7 +75,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe
item.slugWithATag)} + items={tocItems.map((item) => item.slug ? item.slug : item.slugWithATag)} currentClassName='text-primary-500 font-bold' componentTag='div' rootEl={contentSelector} @@ -85,7 +85,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe From 01c535f92a5417949f37091ea5cdfad94a597e1f Mon Sep 17 00:00:00 2001 From: shrey Date: Fri, 10 Jan 2025 01:38:23 +0530 Subject: [PATCH 3/5] fix: linting error --- components/TOC.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/TOC.tsx b/components/TOC.tsx index 4c1ed890a28c..9469c6c55006 100644 --- a/components/TOC.tsx +++ b/components/TOC.tsx @@ -75,7 +75,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe
item.slug ? item.slug : item.slugWithATag)} + items={tocItems.map((item) => (item.slug ? item.slug : item.slugWithATag))} currentClassName='text-primary-500 font-bold' componentTag='div' rootEl={contentSelector} @@ -85,7 +85,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe From 9792eb9ce1881af4c916fa823b5ba1db5cea9fcd Mon Sep 17 00:00:00 2001 From: shrey Date: Fri, 10 Jan 2025 01:53:48 +0530 Subject: [PATCH 4/5] fix: linting error --- components/TOC.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/TOC.tsx b/components/TOC.tsx index 9469c6c55006..8b655b07d784 100644 --- a/components/TOC.tsx +++ b/components/TOC.tsx @@ -85,7 +85,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe From 2195bc4ef9f653892c99e80b6e3b623934946baa Mon Sep 17 00:00:00 2001 From: shrey Date: Fri, 10 Jan 2025 13:19:04 +0530 Subject: [PATCH 5/5] fix: improved regex to include other characters --- components/TOC.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/TOC.tsx b/components/TOC.tsx index 8b655b07d784..e5db11d05e7a 100644 --- a/components/TOC.tsx +++ b/components/TOC.tsx @@ -39,7 +39,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe // a-namedefinitionsapplicationaapplication slugWithATag contains transformed heading name that is later used // for scroll spy identification slugWithATag: item.content - .replace(/[<>?!:`'."\\/=]/gi, '') + .replace(/[<>?!:`'."\\/=*,]/gi, '') .replace(/\s/gi, '-') .toLowerCase() }));