Skip to content

Commit 8c881e6

Browse files
authored
do not error out if TOC parent does not have attribs (#17246)
1 parent 7be7ee9 commit 8c881e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/get-mini-toc-items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function getMiniTocItems (html, maxHeadingLevel = 3) {
1616
const items = headings
1717
.get()
1818
.filter(item => {
19-
if (!item.parent) return true
19+
if (!item.parent || !item.parent.attribs) return true
2020
// Hide any items that belong to a hidden div
2121
const { attribs } = item.parent
2222
return !('hidden' in attribs)

0 commit comments

Comments
 (0)