fireside21 / vscode-cshtml

VS Code syntax highlighting for HTML files with embedded C#
8 stars 3 forks source link

Style #include breaks syntax highlighting #3

Open StructByLightning opened 5 years ago

StructByLightning commented 5 years ago

Using a #include inside a <style> tag breaks syntax highlighting for the rest of the file.

Minimum working example:

<head>
    <style><!-- #include file = "blah/blah/blah/something.css" --></style>
    <script src="this-is-colored-wrong.js"></script>
</head>

What it should look like: image

What it actually looks like: image

Edit: For anyone else who reads this, you can add a {} to fix the highlighting, like this: <style><!-- #include file = "blah/blah/blah/something.css" -->{}</style>

michaelblyons commented 5 years ago

Please note for comparison that the normal HTML syntax (from which this syntax derives) also has the same behavior—HTML comments are unsupported in style element descendants.

msftrncs commented 4 years ago

It is not the HTML/XML comment causing the problem, its the #include rule from CSS, so that also means it has nothing to do with CSHTML.

image