You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When including JavaScript inside of a <script> tag inside of a HTML file, sometimes syntax highlighting breaks and the VSCode gets confused which language to use in the following lines. This also breaks the "Toggle Line Comment" feature. Below is a sample HTML you can paste inside of VSCode to reproduce:
<!DOCTYPE html><html><head><script>constversion=[1,0,0]</script><metacharset="utf-8"><title>Test</title></head><body><p>Try "Toggle Line Comment" on this line!</p></body></html>
When I close the JavaScript with a semicolon however, things behave as expected:
<!DOCTYPE html>
<html>
<head>
- <script>const version=[1,0,0]</script>+ <script>const version=[1,0,0];</script>
<meta charset="utf-8">
<title>Test</title>
</head>
<body>
<p>Try "Toggle Line Comment" on this line!</p>
</body>
</html>
VS Code version: Code 1.61.2 (6cba118, 2021-10-19T14:57:20.575Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No
System Info
Item
Value
CPUs
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
Issue Type: Bug
When including JavaScript inside of a
<script>
tag inside of a HTML file, sometimes syntax highlighting breaks and the VSCode gets confused which language to use in the following lines. This also breaks the "Toggle Line Comment" feature. Below is a sample HTML you can paste inside of VSCode to reproduce:When I close the JavaScript with a semicolon however, things behave as expected:
VS Code version: Code 1.61.2 (6cba118, 2021-10-19T14:57:20.575Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: