-
Notifications
You must be signed in to change notification settings - Fork 29.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
Consider finding a new HTML grammar: URL with double slashes within an onclick element highlighted as a code comment #202915
Comments
Hello @CoconutMacaroon. A workaround to this colorization issue would be to treat the slash / as if it was an escape character: <button onclick="console.log('https:\/\/example.com');">Click me!</button> It would be nice though to dig deeper in it and find out why it's behaving like this. |
duplicate of textmate/html.tmbundle#113 |
Hello @aeschli. Thanks for pointing out to the library textmate/html.tmbundle. However, the PR fix for this issue has been opened there 3 years ago and still hasn't been merged yet. Can we do something regarding it? |
I agree with @perplexyves . The latest commit/issue/MR in that repository is 3 years old. According to the WikiPedia of TextMate:
https://en.wikipedia.org/wiki/TextMate Looks like dead to me too 👍 |
Reopened and repurposed this issue to track finding a new grammar for HTML syntax highlighting. My first look didn't turn up any good options. |
@alexr00 I was preparing an issue about this last night, I left it half finished as draft, but posted it tonight: #203212 Now I noticed you've repurposed this issue for that. Feel free to close what I've just created, but I've left some more information about the problem there that you may find useful |
Does this issue occur when all extensions are disabled?: Yes/No
Yes. I did
code-insiders.cmd --disable-extensions
, and the issue still happened then.1.86.0-insider
Steps to Reproduce:
demo.html
The string renders correctly when in a
<script> ... </script>
tag. However, when placed within anonclick
of a<button> ... </button>
, it (incorrectly) highlights the two slashes and the remainder of the string in green, as if it was a code comment. Interestingly, the semicolon is also green.The expected behavior is that VS Code recognizes that it isn't a comment, but rather part of a string, and so highlights it like it does in the
<script> ... </script>
tag.The text was updated successfully, but these errors were encountered: