Skip to content

Commit

Permalink
fix: toc can be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnaceMaes committed Mar 11, 2024
1 parent 2990429 commit 7cea871
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/modifiers/highlight-active-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default modifier(function highlightActiveTitle(element, [toc]) {
});

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

0 comments on commit 7cea871

Please sign in to comment.