Skip to content

Commit 95e4945

Browse files
committed
fix(app): URL parsing when using @link for @inputs
fix #1125
1 parent 98090ce commit 95e4945

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/app/compiler/angular/deps/helpers/class-helper.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,13 @@ export class ClassHelper {
14121412
_return.jsdoctags = markedtags(jsdoctags[0].tags);
14131413
}
14141414
if (typeof property.jsDoc[0].comment !== 'undefined') {
1415-
const rawDescription = this.jsdocParserUtil.parseJSDocNode(
1416-
property.jsDoc[0]
1415+
const comment = this.jsdocParserUtil.getMainCommentOfNode(
1416+
property,
1417+
sourceFile
14171418
);
1418-
_return.rawdescription = rawDescription;
1419-
_return.description = marked(rawDescription);
1419+
const cleanedDescription = this.jsdocParserUtil.parseComment(comment);
1420+
_return.rawdescription = cleanedDescription;
1421+
_return.description = marked(cleanedDescription);
14201422
}
14211423
}
14221424
}

test/fixtures/todomvc-ng2/src/app/header/header.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class HeaderComponent {
4949
}
5050

5151
/**
52-
* Setter of _fullName
52+
* Setter of _fullName {@link https://compodoc.app/}
5353
* @param {string} newName The new name
5454
*/
5555
@Input()

test/src/cli/cli-generation-big-app.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,4 +870,9 @@ describe('CLI simple generation - big app', () => {
870870
expect(file).to.contain('or link to <a href="../classes/Todo.html">Todo');
871871
expect(file).to.contain('ore link to <a href="../classes/Todo.html">Todo');
872872
});
873+
874+
it('should support JSDoc @link for inputs', () => {
875+
let file = read(distFolder + '/components/HeaderComponent.html');
876+
expect(file).to.contain('_fullName <a href="https://compodoc.app/">https://compodoc.app/');
877+
});
873878
});

0 commit comments

Comments
 (0)