MCPcopy Create free account
hub / github.com/adobe/react-spectrum / anchorId

Function anchorId

packages/dev/s2-docs/src/OptimisticToc.tsx:12–17  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

10import {useRouter} from './Router';
11
12function anchorId(children) {
13 return children
14 .replace(/\s/g, '-')
15 .replace(/[^a-zA-Z0-9-_]/g, '')
16 .toLowerCase();
17}
18
19let tocLinkTextStyle = style({
20 overflowWrap: 'break-word',

Callers 2

TocFunction · 0.70
renderMobileTocFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected