mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
allow consecutive newlines in jsdoc tag comments (#38036)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
*/`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user