Skip to content

[html] Unexpected "Declaration or statement expected" in HTML code #135849

@oliversalzburg

Description

@oliversalzburg

Issue Type: Bug

This code will cause VS Code to raise 3 JS problems

<!DOCTYPE html><html><body><script>//%SCRIPT%</script><script>(function() {
}());</script></body></html>

Changing the code slightly, resolves the problems

<!DOCTYPE html><html><body><script>//%SCRIPT%</script>
<script>(function() {
}());</script></body></html>

To me, this is unexpected.

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
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3592)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 79.87GB (42.74GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu/home/oliver/fairmanager/fairmanager/core-web3 --remote=wsl+Ubuntu --crash-reporter-id 05565d81-cfc4-40de-88df-1c479bbe1bcd
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.16.3-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3591)
Memory (System) 62.71GB (50.55GB free)
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.16.3-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3591)
Memory (System) 62.71GB (50.55GB free)
VM 0%
Extensions (38)
Extension Author (truncated) Version
tsl-problem-matcher amo 0.5.0
javascript-ejs-support Dig 1.3.1
eslint-disable-snippets drK 1.3.0
output-colorizer IBM 0.1.2
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.202.5
remote-ssh ms- 0.65.8
remote-ssh-edit ms- 0.65.8
remote-wsl ms- 0.58.3
vscode-remote-extensionpack ms- 0.21.0
vscode-icons vsc 11.6.0
vscode-zipfs arc 2.3.0
better-toml bun 0.3.2
vscode-eslint dba 2.2.2
xml Dot 2.5.1
EditorConfig Edi 0.16.4
prettier-vscode esb 9.0.0
generateuuid Fir 0.0.5
shell-format fox 7.1.1
vscode-graphql Gra 0.3.18
yarn2-dependency-explorer hah 0.0.1
terraform has 2.16.0
vscode-esformatter how 1.6.0
vscode-random jre 1.10.0
template-string-converter meg 0.5.3
code-beautifier mic 2.3.3
vscode-docker ms- 1.17.0
vscode-kubernetes-tools ms- 1.3.3
python ms- 2021.10.1365161279
vscode-pylance ms- 2021.10.2
jupyter ms- 2021.9.1101343141
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.3
test-adapter-converter ms- 0.1.4
vscode-js-profile-flame ms- 0.0.21
vscode-paste-image mus 1.0.4
monolit Oli 0.0.33
vscode-yaml red 1.0.0

(1 theme extensions excluded)

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughtmlHTML support issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions