Skip to content

Commit 422e3dd

Browse files
Gregor Mayrblakeembrey
authored andcommitted
Fix whitespace across multiline comments (#606)
1 parent c77b0fc commit 422e3dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/converter/factories/comment.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ export function parseComment(text: string, comment: Comment = new Comment()): Co
119119
return line.trim();
120120
}
121121

122-
function readBareLine(line: string) {
122+
function readBareLine(line: string, rawLine: string) {
123123
if (currentTag) {
124-
currentTag.text += '\n' + line;
124+
currentTag.text += '\n' + rawLine;
125125
} else if (line === '' && shortText === 0) {
126126
// Ignore
127127
} else if (line === '' && shortText === 1) {
@@ -161,14 +161,15 @@ export function parseComment(text: string, comment: Comment = new Comment()): Co
161161
}
162162

163163
function readLine(line: string) {
164+
const rawLine = line;
164165
line = line.replace(/^\s*\*? ?/, '');
165166
line = line.replace(/\s*$/, '');
166167

167168
const tag = /^@(\S+)/.exec(line);
168169
if (tag) {
169170
readTagLine(line, tag);
170171
} else {
171-
readBareLine(line);
172+
readBareLine(line, rawLine);
172173
}
173174
}
174175

0 commit comments

Comments
 (0)