Skip to content

Commit

Permalink
fix(app): @link in @see JSDoc tag
Browse files Browse the repository at this point in the history
fix #1104
  • Loading branch information
vogloblinsky committed Sep 16, 2021
1 parent b31604c commit ba13a85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/utils/jsdoc-parser.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ export class JsdocParserUtil {

if (!inCode) {
const tag = /^@(\S+)/.exec(line);
if (tag) {
const SeeTag = /^@see/.exec(line);

if (SeeTag) {
line = line.replace(/^@see/, 'See');
}

if (tag && !SeeTag) {
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class TodoStore {
/**
* Remove todo
*
* See {@link Todo}
* @see {@link Todo} for details
*
* @param {Todo} todo Todo to remove
* @param {any[]} theArgs the rest of arguments
Expand Down
5 changes: 5 additions & 0 deletions test/src/cli/cli-generation-big-app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,4 +859,9 @@ describe('CLI simple generation - big app', () => {
'A TodoStore -&gt; see <a href="../injectables/TodoStore.html">TodoStore'
);
});

it('should support JSDoc @link in JSDoc @see tag', () => {
let file = read(distFolder + '/injectables/TodoStore.html');
expect(file).to.contain('See <a href="../classes/Todo.html">Todo</a> for details');
});
});

0 comments on commit ba13a85

Please sign in to comment.