diff --git a/src/client/app/index.ts b/src/client/app/index.ts index b3ec5e90..795674a2 100644 --- a/src/client/app/index.ts +++ b/src/client/app/index.ts @@ -152,7 +152,7 @@ if (inBrowser) { // scroll to hash on new tab during dev if (import.meta.env.DEV && location.hash) { - const target = document.querySelector(location.hash) + const target = document.querySelector(decodeURIComponent(location.hash)) if (target) { scrollTo(target, location.hash) } diff --git a/src/client/theme-default/components/VPSkipLink.vue b/src/client/theme-default/components/VPSkipLink.vue index 492e0148..69f17a44 100644 --- a/src/client/theme-default/components/VPSkipLink.vue +++ b/src/client/theme-default/components/VPSkipLink.vue @@ -9,7 +9,7 @@ watch(() => route.path, () => backToTop.value.focus()) function focusOnTargetAnchor({ target }: Event) { const el = document.querySelector( - (target as HTMLAnchorElement).hash + decodeURIComponent((target as HTMLAnchorElement).hash) ) if (el) {