vdoc: fix search in README index.html when generated with v doc -f html -m -readme flags (#21506)

This commit is contained in:
Turiiya 2024-05-15 20:06:26 +02:00 committed by GitHub
parent 58a8fc6c13
commit 8a515c03b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,9 @@
function setupScrollSpy() {
const mainContent = document.querySelector('#main-content');
const toc = mainContent.querySelector('.doc-toc');
if (!toc) {
return;
}
const sections = mainContent.querySelectorAll('section');
const sectionPositions = Array.from(sections).map((section) => section.offsetTop);
let lastActive = null;