From 51782cfa5dd9c4e9926998ab8796a5ff47482962 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 20 Dec 2022 21:19:31 +0100 Subject: [PATCH] chore: fix docs roll (#19605) --- utils/doclint/documentation.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/utils/doclint/documentation.js b/utils/doclint/documentation.js index 6488fdc29c..b17546b39e 100644 --- a/utils/doclint/documentation.js +++ b/utils/doclint/documentation.js @@ -170,18 +170,19 @@ class Documentation { this._patchLinksInText = (classOrMember, text) => patchLinksInText(classOrMember, text, classesMap, membersMap, linkRenderer); for (const clazz of this.classesArray) - clazz.visit(item => this.renderLinksInNodes(item)); + clazz.visit(item => item.spec && this.renderLinksInNodes(item.spec, item)); } /** + * @param {MarkdownNode[]} nodes * @param {Class|Member=} classOrMember */ - renderLinksInNodes(classOrMember) { - if (!classOrMember?.spec) - return; - classOrMember.discouraged = this.renderLinksInText(classOrMember.discouraged || '', classOrMember); - classOrMember.deprecated = this.renderLinksInText(classOrMember.deprecated || '', classOrMember); - md.visitAll(classOrMember.spec, node => { + renderLinksInNodes(nodes, classOrMember) { + if (classOrMember instanceof Member) { + classOrMember.discouraged = classOrMember.discouraged ? this.renderLinksInText(classOrMember.discouraged, classOrMember) : undefined; + classOrMember.deprecated = classOrMember.deprecated ? this.renderLinksInText(classOrMember.deprecated, classOrMember) : undefined + } + md.visitAll(nodes, node => { if (!node.text) return; node.text = this.renderLinksInText(node.text, classOrMember);