Skip to content

Commit

Permalink
fix: return single backslash at end of comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rmhartog committed Jun 11, 2024
1 parent 5deb6ff commit 7069530
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/compiler/src/core/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ export function createScanner(

case CharCode.Backslash:
tokenFlags |= TokenFlags.Escaped;
return next(Token.DocText, 2);
return position === endPosition - 1 ? next(Token.DocText) : next(Token.DocText, 2);

case CharCode.Space:
case CharCode.Tab:
Expand Down Expand Up @@ -1057,6 +1057,10 @@ export function createScanner(
continue;
}

if (pos === end - 1) {
break;
}

result += input.substring(start, pos);
switch (input.charCodeAt(pos + 1)) {
case CharCode.At:
Expand All @@ -1069,7 +1073,7 @@ export function createScanner(
start = pos;
}

result += input.substring(start, pos);
result += input.substring(start, end);
return result;
} else {
return input.substring(tokenPosition, position);
Expand Down

0 comments on commit 7069530

Please sign in to comment.