Skip to content

Commit 7cea871

Browse files
committed
fix: toc can be undefined
1 parent 2990429 commit 7cea871

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addon/modifiers/highlight-active-title.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default modifier(function highlightActiveTitle(element, [toc]) {
1414
});
1515

1616
// Track all content sections by id
17-
toc.forEach((tocItem) => {
17+
toc?.forEach((tocItem) => {
1818
const tocSection = document.querySelector(
1919
`section[aria-labelledby="${tocItem.id}"]`
2020
);

0 commit comments

Comments
 (0)