We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c73bf9d commit 1a78dc2Copy full SHA for 1a78dc2
1 file changed
website/result.html
@@ -39,7 +39,7 @@
39
.replaceAll("/", "");
40
const anchor = document.createElement("a");
41
anchor.id = anchorId;
42
- anchor.href = "#" + anchorId;
+ anchor.href = `#${anchorId}`;
43
anchor.classList.add("heading-anchor");
44
anchor.textContent = "#";
45
heading.appendChild(anchor);
@@ -48,7 +48,10 @@
48
const hash = window.location.hash;
49
if (hash) {
50
const decodedHash = decodeURIComponent(hash);
51
- const target = document.querySelector(decodedHash);
+ const targetId = decodedHash.startsWith("#")
52
+ ? decodedHash.slice(1)
53
+ : decodedHash;
54
+ const target = document.getElementById(targetId);
55
if (target) {
56
target.scrollIntoView();
57
}
0 commit comments