html.tmbundle
html.tmbundle copied to clipboard
Embedded JavaScript grammar can break the colorization
The following code doesn't highlight correctly in VSCode after //</script>
. The problem is that the embedded JavaScript grammar consumes the full //</script>
and the sourrounding html rule doesn't end. The grammar is stuck in js
.
<!DOCTYPE html>
<html>
<head>
<script>
//</script>
</head>
<body>
</body>
</html>
There are many similar issues when the JS code is not complete and the JavaScript grammar is in the middle of some rule.
IMO the best thing would be to not include the full blown JavaScript grammar but embed a (simplified) variant that is aware of the </script>
tag