chore: fix docs roll (#19605)

This commit is contained in:
Max Schmitt 2022-12-20 21:19:31 +01:00 committed by GitHub
parent 3555dbd4b4
commit 51782cfa5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);