TS syntax highlighter confuses apostrophe in Regexp literal #91537
Labels
*duplicate
Issue identified as a duplicate of another issue(s)
grammar
Syntax highlighting grammar
javascript
JavaScript support issues
typescript
Typescript support issues
Steps to Reproduce:
export const c1 = "abc";
if (!/^['"]$/.test(c1)) { }
export const c2 = 2;
The code after the apostrophe in the RE will be rendered as string. The keywords "export const" in the third line will not be highlighted anymore.
Removing the exclamation mark before the RE lets the bug disappear, as well as enclosing the RE into parentheses.
The text was updated successfully, but these errors were encountered: