Skip to content

Commit 71a2adb

Browse files
authored
Fix Anchor jumping with escaped query components (#14969) (#14977)
Backport #14969 Fix #14968 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 3231b70 commit 71a2adb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/markdown/anchors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const headingSelector = '.markdown h1, .markdown h2, .markdown h3, .markdown h4,
55
function scrollToAnchor() {
66
if (document.querySelector(':target')) return;
77
if (!window.location.hash || window.location.hash.length <= 1) return;
8-
const id = window.location.hash.substring(1);
8+
const id = decodeURIComponent(window.location.hash.substring(1));
99
const el = document.getElementById(`user-content-${id}`);
1010
if (el) {
1111
el.scrollIntoView();

0 commit comments

Comments
 (0)