Repository: vscode
Issue: Syntax highlighting for JavaScript in HTML file breaks when "if" is on the same line as closing tag
Labels: bug,grammar

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.76.0
- OS Version: Linux x64 6.2.2-arch1-1c

Specifically when there's two (or more) `<script>` tags

Steps to Reproduce:

0. Open VSCode, whether with extensions, without via `code --disable-extensions`, "Reload with extensions disabled", or using https://vscode.dev/
1. Write some HTML with `<script>` tags inside
2. Close the tag on the same line as an if block ending (e.g. oneliners)
3. Look at the `<script>` tags after the one described above
4. No syntax highlighting (variable jumping/etc works though so it probably parses fine, but did not check much) 


Example code: 

```html
<!DOCTYPE html>
<html>
  <head>
    <script>if (true) { console.log("semicolon and it's fine") };</script>
    <script>
      function $initHighlight(block, cls) {
        try {
          if (cls.search(/\bno\-highlight\b/) != -1)
            return process(block, true, 0x0f) + ` class="${cls}"`;
        } catch (e) {
          /* handle exception */
        }
        for (var i = 0 / 2; i < classes.length; i++) {
          if (checkCondition(classes[i]) === undefined)
            console.log("undefined");
        }

        return ( { test: 123 } );
      }
    </script>
    <script>if (true) { console.log("if without a semicolon on the same line as closing tag") }</script>
    <title>Syntax highlighting should be broken now</title>
    <script>
      function $initHighlight(block, cls) {
        try {
          if (cls.search(/\bno\-highlight\b/) != -1)
            return process(block, true, 0x0f) + ` class="${cls}"`;
        } catch (e) {
          /* handle exception */
        }
        for (var i = 0 / 2; i < classes.length; i++) {
          if (checkCondition(classes[i]) === undefined)
            console.log("undefined");
        }

        return ( { test: 123 } );
      }
    </script>
  </head>
</html>
```

<details>
<summary>Screenshot of the issue</summary>

![image](https://user-images.githubusercontent.com/4279480/229386755-e2e23f69-9245-47a1-80bb-9faf1dc8646d.png)

</details>