-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(groovy) strings are not allowed inside ternary clauses #2217
Comments
Sounds like some issue with expectations around new lines... anyway you could make a jsfiddle of this so we can easily track it over time and confirm it? Or if you want to make an attempt at fixing it that'd be amazing. :-) You can fork my template: |
Hi, here's the jsfiddle https://jsfiddle.net/j4gq5at6/ |
Thanks, yeah something strange is in the neighborhood there. |
@yyyc514 i guess it's because of https://github.com/highlightjs/highlight.js/blob/master/src/highlight.js#L938 (as that piece of text actually includes \n) |
Oh, just tested, nope. |
No that's not it because the string is terminated, it doesn't bridge multiple lines. |
It doesn't like the ternary, but not sure why. |
Guessing this is it. It needs to be updated to know that strings are allowed to existing inside ternary's so that string grabs the ":" inside strings, not the ternary rule. |
If you do for example:
'The following files need formatting:\n ' is not highlighted correctly as a string, secondly everything after ' + is coloured in blue (so if you create another def after, it colours all that in blue).
The text was updated successfully, but these errors were encountered: