зеркало из https://github.com/github/docs.git
do not error out if TOC parent does not have attribs (#17246)
This commit is contained in:
Родитель
7be7ee9215
Коммит
8c881e6b1a
|
@ -16,7 +16,7 @@ module.exports = function getMiniTocItems (html, maxHeadingLevel = 3) {
|
|||
const items = headings
|
||||
.get()
|
||||
.filter(item => {
|
||||
if (!item.parent) return true
|
||||
if (!item.parent || !item.parent.attribs) return true
|
||||
// Hide any items that belong to a hidden div
|
||||
const { attribs } = item.parent
|
||||
return !('hidden' in attribs)
|
||||
|
|
Загрузка…
Ссылка в новой задаче