We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7da4f02 commit 6004e83Copy full SHA for 6004e83
apps/svelte.dev/src/routes/docs/[...path]/+page.svelte
@@ -6,6 +6,7 @@
6
import OnThisPage from './OnThisPage.svelte';
7
import Breadcrumbs from './Breadcrumbs.svelte';
8
import PageControls from '$lib/components/PageControls.svelte';
9
+ import { goto } from '$app/navigation';
10
11
let { data } = $props();
12
@@ -36,7 +37,10 @@
36
37
for (const heading of content.querySelectorAll('[id]')) {
38
// e.g. we want to redirect progressive-enhancement-use-enhance to Progressive-enhancement-use:enhance
39
if (heading.id.toLowerCase().replaceAll(':', '-') === id) {
- location.hash = heading.id;
40
+ goto(`#${heading.id}`, {
41
+ replaceState: true
42
+ });
43
+
44
break;
45
}
46
0 commit comments