Breaks highlighting HTML when a script tag omits semicolons
See original GitHub issueAll the info you need is in this issue: https://github.com/microsoft/vscode/issues/121577
I’ll just copy over the contents of this comment:
Looks like it’s exactly the same as my other screenshot.
What I find interesting is when I put my cursor on the closing </script>
html tag or even the </html>
, it incorrectly identifies language as “JavaScript”
However, if I add a semicolon, it correctly identifies it as HTML:
I would expect it to be able to identify it as the correct language regardless of the presence of the semicolon.
Once I switched off this plugin I no longer had these problems:
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
HTML Semantic Highlight with <script> tag #121577 - GitHub
Issue Type: Bug Create an HTML file with a script tag, i.e.: Title en. ... But... same code without semicolons is being highlighted...
Read more >Semicolons in JavaScript: To Use or Not to Use?
1- A semicolon will be inserted when it comes across a line terminator or a '}' that is not grammatically correct. So, if...
Read more >JavaScript: How Line Breaks and Missing Semicolons Can ...
You can omit the semicolon if the statements are written in separate lines. In this case, JavaScript adds the semicolon implicitly. But one ......
Read more >Syntax highlighting is broken when you don't specify a ...
Here's a question I noticed it on since it has HTML, JS, and CSS blocks that are all not being colored correctly or...
Read more >HTML and CSS Tutorial - Nanyang Technological University
This is my first web page written in HTML. HTML. HTML uses markup tag to markup a document. Use a source-code editor, which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Putting a pin in this for now, so using this thread for note-taking. The following simple cases seem to break the highlighting.:
Like I mentioned, debugging this is pretty difficult, but narrowing it down to these cases is a start. There’s an issue with a regex somewhere, it’s just a matter of tracking it down.
Thanks! After disabling this extension for a while I actually realized I’m not sure I need this extension anymore 😅 But if I decide I do I’ll try this out and let you know. Thanks Michael!