Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect highlighting of JavaScript with template strings after dangling comma #5036

Closed
marcins opened this issue Oct 18, 2017 · 2 comments
Closed

Comments

@marcins
Copy link

marcins commented Oct 18, 2017

I managed to find a case where template string highlighting doesn't "end" properly. Here's the minimal reproduction I was able to boil it down to (tested via https://codemirror.net/mode/javascript/index.html):

fn({
  ...blah,
});

const c = `b${c.d}`;
// ^ semi-colon onwards is "red"
const d = 'foo';

It seems to specifically be the combo of a function call, object, destructuring and the dangling comma. Removing any of those parts the highlighting works correctly.

@marijnh
Copy link
Member

marijnh commented Oct 18, 2017

Thanks for noticing that. Attached patch should help.

@marcins
Copy link
Author

marcins commented Oct 18, 2017

Thanks for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants