diff options
author | zeripath | 2021-03-13 09:54:53 +0000 |
---|---|---|
committer | GitHub | 2021-03-13 09:54:53 +0000 |
commit | 71a2adbf10f0f3df9d9f2ab59c51bbcb19c00c4b (patch) | |
tree | 22fa79c8092c5c775f85a6a0ce1626c62c61f0b7 | |
parent | 3231b70043039d1acd722115acf0e3022a81ca85 (diff) |
Fix Anchor jumping with escaped query components (#14969) (#14977)
Backport #14969
Fix #14968
Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r-- | web_src/js/markdown/anchors.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/markdown/anchors.js b/web_src/js/markdown/anchors.js index b7d0a1f60..62bf8c83c 100644 --- a/web_src/js/markdown/anchors.js +++ b/web_src/js/markdown/anchors.js @@ -5,7 +5,7 @@ const headingSelector = '.markdown h1, .markdown h2, .markdown h3, .markdown h4, function scrollToAnchor() { if (document.querySelector(':target')) return; if (!window.location.hash || window.location.hash.length <= 1) return; - const id = window.location.hash.substring(1); + const id = decodeURIComponent(window.location.hash.substring(1)); const el = document.getElementById(`user-content-${id}`); if (el) { el.scrollIntoView(); |