File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
apps/svelte.dev/src/routes/docs/[...path] Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 32
32
return ;
33
33
}
34
34
35
- const id = hash .toLowerCase ().replaceAll (' :' , ' -' );
35
+ // kit/svelte4 replaced `:` character
36
+ // e.g. we want to redirect progressive-enhancement-use-enhance to Progressive-enhancement-use:enhance
37
+ // kit docs also had types in URL that we want to replace. e.g.
38
+ // https://kit.svelte.dev/docs/types#public-types-loadevent
39
+ // https://kit.svelte.dev/docs/types#private-types-cspdirectives
40
+ const id = hash
41
+ .toLowerCase ()
42
+ .replaceAll (' :' , ' -' )
43
+ .replaceAll (' public-types-' , ' ' )
44
+ .replaceAll (' private-types-' , ' ' );
36
45
37
46
for (const heading of content .querySelectorAll (' [id]' )) {
38
- // e.g. we want to redirect progressive-enhancement-use-enhance to Progressive-enhancement-use:enhance
39
47
if (heading .id .toLowerCase ().replaceAll (' :' , ' -' ) === id ) {
40
48
goto (` #${heading .id } ` , {
41
49
replaceState: true
You can’t perform that action at this time.
0 commit comments