Skip to content

Commit

Permalink
repo sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Octomerger authored Dec 30, 2020
2 parents 9b0c4a4 + 258e833 commit e6573a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/get-mini-toc-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ module.exports = function getMiniTocItems (html, maxHeadingLevel = 3) {
// - `platform` to show or hide platform-specific headings via client JS
const items = headings
.get()
.filter(item => {
if (!item.parent) return true
// Hide any items that belong to a hidden div
const { attribs } = item.parent
return !('hidden' in attribs)
})
.map(item => {
// remove any <span> tags including their content
$('span').remove()
Expand Down

0 comments on commit e6573a0

Please sign in to comment.