mirror of
https://github.com/go-gitea/gitea
synced 2024-12-25 06:25:02 +01:00
Fix Anchor jumping with escaped query components (#14969)
Fix #14968 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
42b9b46ad2
commit
ff1bccf3dd
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ const headingSelector = '.markdown h1, .markdown h2, .markdown h3, .markdown h4,
|
||||||
function scrollToAnchor() {
|
function scrollToAnchor() {
|
||||||
if (document.querySelector(':target')) return;
|
if (document.querySelector(':target')) return;
|
||||||
if (!window.location.hash || window.location.hash.length <= 1) 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}`);
|
const el = document.getElementById(`user-content-${id}`);
|
||||||
if (el) {
|
if (el) {
|
||||||
el.scrollIntoView();
|
el.scrollIntoView();
|
||||||
|
|
Loading…
Reference in a new issue