HTML syntax highlighter error: closing tags are not allowed to have attributes #130284
Labels
grammar
Syntax highlighting grammar
upstream-issue-linked
This is an upstream issue that has been reported upstream
Issue Type: Bug
I had a copy/paste error in my source HTML that led to a very subtle bug in my rendered HTML.
Consider this input:
The final two of three DIV element tags are actually end tags when they were intended to be start tags. The browser handled this by eliding the end tags entirely.
The DOM effectively had this instead:
Now consider how the syntax is highlighted in VSCode:
I noticed this later when I used jquery to select the elements with affected ids - there were no
div
elements at all with the ids I expected, but the label and input elements were present. So, the page looked correct, but I couldn't select the entered values using jquery because the neededdiv
with the ID wasn't there.So, please improve the HTML syntax highlighter to visually "complain" about end tags that have attributes. This is not valid HTML and should never be allowed.
VS Code version: Code 1.58.2 (c3f1263, 2021-07-14T22:09:06.581Z)
OS version: Darwin x64 18.7.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (19)
A/B Experiments
The text was updated successfully, but these errors were encountered: