question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breaks highlighting HTML when a script tag omits semicolons

See original GitHub issue

All 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:

image

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”

image

However, if I add a semicolon, it correctly identifies it as HTML:

image

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:

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelgmcdcommented, Sep 8, 2021

Putting a pin in this for now, so using this thread for note-taking. The following simple cases seem to break the highlighting.:

<script>
  let foo
</script>
<script>
  foo.bar()
</script>

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.

0reactions
kentcdoddscommented, Sep 10, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found