Skip to content

Commit 52fa30a

Browse files
committed
fix(search): Scroll to heading position.
1 parent b55fe95 commit 52fa30a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

assets/webpage.txt.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,10 @@ async function loadDocument(url, pushHistory = true, scrollTo = true)
384384
let splitURL = url.split("#");
385385
let pathnameTarget = splitURL[0] ?? url;
386386
let headingTarget = splitURL.length > 1 ? splitURL[1] : null;
387-
if (headingTarget) document.getElementById(headingTarget).scrollIntoView();
387+
if (headingTarget) {
388+
headingTarget = decodeURIComponent(headingTarget).replaceAll(' ', '_');
389+
document.getElementById(headingTarget).scrollIntoView();
390+
}
388391

389392
// Change the root path to match the match from the new page
390393
setupRootPath(doc);

0 commit comments

Comments
 (0)