Skip to content

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

Fix anchor text formatting

Terry Sutton165534e6a266
diff --git a/apps/temp-docs/components/CustomMDX/CustomMDX.utils.ts b/apps/temp-docs/components/CustomMDX/CustomMDX.utils.ts
index f768c93215d..2ad270cae5a 100644
--- a/apps/temp-docs/components/CustomMDX/CustomMDX.utils.ts
+++ b/apps/temp-docs/components/CustomMDX/CustomMDX.utils.ts
@@ -2,8 +2,10 @@ export const getAnchor = (text: any): string | undefined => {
if (typeof text !== 'string') {
return undefined
} else {
- const [anchor] = text.match(/{#[a-z-]*}/g) || []
- return anchor !== undefined ? anchor.slice(2, anchor.length - 1) : undefined
+ return text
+ .toLowerCase()
+ .replace(/[^a-z0-9 ]/g, '')
+ .replace(/[ ]/g, '-')
}
}