File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { fileURLToPath } from 'node:url'
88import { defineConfig } from 'vitepress'
99import languages from './languages'
1010import playground from './lib/cds-playground/index.js'
11+ import { slugify } from './lib/slugify.ts'
1112import { Menu } from './menu.js'
1213
1314const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
@@ -46,10 +47,7 @@ const config = defineConfig({
4647 } ,
4748 anchor : {
4849 // VS Code-compatible GitHub-style slugifier (mirrors markdown-language-features/src/slugify.ts)
49- slugify : ( str ) => str
50- . trim ( ) . toLowerCase ( )
51- . replace ( / [ ^ \p{ L} \p{ N} \p{ M} \s _ - ] / gu, '' )
52- . replace ( / \s / g, '-' ) ,
50+ slugify,
5351 } ,
5452 container : { // Doesn't seem to work yet
5553 infoLabel : 'Info' ,
Original file line number Diff line number Diff line change 1+ // VS Code-compatible GitHub-style slugifier (mirrors markdown-language-features/src/slugify.ts).
2+ // Used as VitePress' markdown anchor slugifier, and reused to derive heading anchors elsewhere (e.g. llms-full.txt).
3+ export function slugify ( str : string ) : string {
4+ return str
5+ . trim ( ) . toLowerCase ( )
6+ . replace ( / [ ^ \p{ L} \p{ N} \p{ M} \s _ - ] / gu, '' )
7+ . replace ( / \s / g, '-' )
8+ }
You can’t perform that action at this time.
0 commit comments