Browse Source

Fix Anchor jumping with escaped query components (#14969) (#14977)

Backport #14969

Fix #14968

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.13.5
zeripath 3 years ago
parent
commit
71a2adbf10
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      web_src/js/markdown/anchors.js

+ 1
- 1
web_src/js/markdown/anchors.js View File

@@ -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();

Loading…
Cancel
Save