Skip to content

Commit e6573a0

Browse files
authored
repo sync
2 parents 9b0c4a4 + 258e833 commit e6573a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/get-mini-toc-items.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = function getMiniTocItems (html, maxHeadingLevel = 3) {
1515
// - `platform` to show or hide platform-specific headings via client JS
1616
const items = headings
1717
.get()
18+
.filter(item => {
19+
if (!item.parent) return true
20+
// Hide any items that belong to a hidden div
21+
const { attribs } = item.parent
22+
return !('hidden' in attribs)
23+
})
1824
.map(item => {
1925
// remove any <span> tags including their content
2026
$('span').remove()

0 commit comments

Comments
 (0)