allow consecutive newlines in jsdoc tag comments (#38036)

This commit is contained in:
Michael Hensler
2020-07-02 15:19:37 -06:00
committed by GitHub
parent 93ccc17658
commit 2d09da6df5
3 changed files with 40 additions and 5 deletions

View File

@@ -7440,11 +7440,9 @@ namespace ts {
loop: while (true) {
switch (tok) {
case SyntaxKind.NewLineTrivia:
if (state >= JSDocState.SawAsterisk) {
state = JSDocState.BeginningOfLine;
// don't use pushComment here because we want to keep the margin unchanged
comments.push(scanner.getTokenText());
}
state = JSDocState.BeginningOfLine;
// don't use pushComment here because we want to keep the margin unchanged
comments.push(scanner.getTokenText());
indent = 0;
break;
case SyntaxKind.AtToken:

View File

@@ -320,6 +320,12 @@ namespace ts {
`/**
* @author John Doe <john.doe@example.com>
* @author John Doe <john.doe@example.com> unexpected comment
*/`);
parsesCorrectly("consecutive newline tokens",
`/**
* @example
* Some\n\n * text\r\n * with newlines.
*/`);
});
});