We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3502d40 commit 0025d53Copy full SHA for 0025d53
src/parser.ts
@@ -435,14 +435,14 @@ export function parseFromProgram(
435
if (comments && comments.length === 1) {
436
const commentNode = comments[0];
437
if (ts.isJSDoc(commentNode)) {
438
- return (
439
- commentNode
440
- // Full comment text
441
- .getText()
442
- // Remove markers (/**\n* */)
443
- .replace(/(^\/\*\*.*$)|(^ *\*\/)|(^ *\* ?)/gm, '')
444
- .trim()
445
- );
+ let commentText = commentNode.comment ? commentNode.comment : '';
+ if (commentNode.tags) {
+ const tags = commentNode.tags
+ .map(tag => tag.getText().trim())
+ .reduce((prev, curr) => `${prev}\n${curr}`);
+ commentText = commentText ? `${commentText}\n${tags}` : tags;
+ }
+ return commentText;
446
}
447
448
0 commit comments