Skip to content

Commit 8a515c0

Browse files
authored
vdoc: fix search in README index.html when generated with v doc -f html -m -readme flags (#21506)
1 parent 58a8fc6 commit 8a515c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/tools/vdoc/theme/doc.js

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
function setupScrollSpy() {
1313
const mainContent = document.querySelector('#main-content');
1414
const toc = mainContent.querySelector('.doc-toc');
15+
if (!toc) {
16+
return;
17+
}
1518
const sections = mainContent.querySelectorAll('section');
1619
const sectionPositions = Array.from(sections).map((section) => section.offsetTop);
1720
let lastActive = null;

0 commit comments

Comments
 (0)