Files
supabase/packages/ui-patterns/Toc/mdx-plugins/remark-utils.ts
T
Francesco Sansalvadore d24df14aab Feat/toc component (#33964)
* test fuma toc

* make toc work

* ok toc

* ui-patterns toc

* fix types

* cleanup

* fix overflow issues

* cleanup

* fix loading w

* Update apps/docs/components/GuidesTableOfContents.tsx

* fix prettier

* format

* install deps

* target ES2018

* tweak regex

* update docs test snapshots

* fix useSubscribeTocRerender
2025-03-05 23:10:02 +01:00

10 lines
247 B
TypeScript

// import type { RootContent } from 'mdast'
export function flattenNode(node: any): string {
if ('children' in node) return node.children.map((child: any) => flattenNode(child)).join('')
if ('value' in node) return node.value
return ''
}