From eefdb2c588f378ebea2abc11903d66af3b24e908 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 15 Feb 2020 20:36:33 -0700 Subject: [PATCH] fix: Don't remove braces containing a tag Closes #1001 Co-Authored-By: Raynor Chen --- src/lib/converter/factories/comment.ts | 2 +- src/test/converter/comment/comment.ts | 2 +- src/test/converter/comment/specs.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/converter/factories/comment.ts b/src/lib/converter/factories/comment.ts index 3d4726669..554e204a1 100644 --- a/src/lib/converter/factories/comment.ts +++ b/src/lib/converter/factories/comment.ts @@ -142,7 +142,7 @@ export function parseComment(text: string, comment: Comment = new Comment()): Co let shortText = 0; function consumeTypeData(line: string): string { - line = line.replace(/^\{[^\}]*\}+/, ''); + line = line.replace(/^\{(?!@)[^\}]*\}+/, ''); line = line.replace(/^\[[^\[][^\]]*\]+/, ''); return line.trim(); } diff --git a/src/test/converter/comment/comment.ts b/src/test/converter/comment/comment.ts index fd4606841..bf24c2263 100644 --- a/src/test/converter/comment/comment.ts +++ b/src/test/converter/comment/comment.ts @@ -82,7 +82,7 @@ export class CommentedClass { /** Function description * - * @param scope Test description. + * @param scope {@link CommentedClass} Test description. * @returns Test description. */ export function gh1164(scope: string) { diff --git a/src/test/converter/comment/specs.json b/src/test/converter/comment/specs.json index 04d70de99..5d2d50e11 100644 --- a/src/test/converter/comment/specs.json +++ b/src/test/converter/comment/specs.json @@ -181,7 +181,7 @@ "isExported": true }, "comment": { - "text": "Test description." + "text": "{@link CommentedClass} Test description." }, "type": { "type": "intrinsic",