diff options
author | zeripath <art27@cantab.net> | 2021-03-12 18:59:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-12 18:59:13 +0000 |
commit | ff1bccf3ddf0662f58f9e1a532b8b082ae04af23 (patch) | |
tree | 8dc8e4f138e595eaef7659d7ddb9843c81d58cb2 /web_src | |
parent | 42b9b46ad22840966ecac70ae4e319c49fda3d7e (diff) | |
download | gitea-ff1bccf3ddf0662f58f9e1a532b8b082ae04af23.tar.gz gitea-ff1bccf3ddf0662f58f9e1a532b8b082ae04af23.zip |
Fix Anchor jumping with escaped query components (#14969)
Fix #14968
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'web_src')
-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 b7d0a1f608..62bf8c83c3 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(); |