This commit is contained in:
Gleb A. 2025-03-07 21:48:54 +00:00 committed by GitHub
commit 1fe835ecc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,10 +32,12 @@ function buildIdToNavigationElementMap(navigation: NodeListOf<Element>): IdToEle
const sectionLinkRef: IdToElementMap = {}; const sectionLinkRef: IdToElementMap = {};
navigation.forEach((navigationElement: HTMLElement) => { navigation.forEach((navigationElement: HTMLElement) => {
const link = navigationElement.querySelector("a"); const link = navigationElement.querySelector("a");
if (link) {
const href = link.getAttribute("href"); const href = link.getAttribute("href");
if (href.startsWith("#")) { if (href.startsWith("#")) {
sectionLinkRef[href.slice(1)] = navigationElement; sectionLinkRef[href.slice(1)] = navigationElement;
} }
}
}); });
return sectionLinkRef; return sectionLinkRef;