Skip to content

Commit

Permalink
fix(app): rawDescription for JSDoc and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Jul 14, 2021
1 parent c1282d2 commit 125641b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/app/compiler/angular-dependencies.ts
Expand Up @@ -756,7 +756,29 @@ export class AngularDependencies extends FrameworkDependencies {
deps.initializer = infos.initializer;
}
if (node.jsDoc && node.jsDoc.length > 0 && node.jsDoc[0].comment) {
const rawDescription = node.jsDoc[0].comment;
const len = node.jsDoc[0].comment.length;
let rawDescription = '';

for (let i = 0; i < len; i++) {
const JSDocNode = node.jsDoc[0].comment[i];
switch (JSDocNode.kind) {
case SyntaxKind.JSDocText:
rawDescription += JSDocNode.text;
break;
case SyntaxKind.JSDocLink:
if (JSDocNode.name) {
rawDescription +=
JSDocNode.text +
'{@link ' +
JSDocNode.name.escapedText +
'}';
}
break;
default:
break;
}
}

deps.rawdescription = rawDescription;
deps.description = marked(rawDescription);
}
Expand Down

0 comments on commit 125641b

Please sign in to comment.