fix: decode href before using as query selector (#951)

pull/973/head
Divyansh Singh 2 years ago committed by GitHub
parent 0dafee79dd
commit 22006e8d6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,9 @@ const resolvedHeaders = computed(() => {
function handleClick({ target: el }: Event) { function handleClick({ target: el }: Event) {
const id = '#' + (el as HTMLAnchorElement).href!.split('#')[1] const id = '#' + (el as HTMLAnchorElement).href!.split('#')[1]
const heading = document.querySelector(id) as HTMLAnchorElement const heading = document.querySelector(
decodeURIComponent(id)
) as HTMLAnchorElement
heading?.focus() heading?.focus()
} }
</script> </script>

Loading…
Cancel
Save