Skip to content

[html] validation error on JavaScript block comment with arrow in HTML script #171153

@mpf82

Description

@mpf82

Does this issue occur when all extensions are disabled?

Yes, all extensions have been disabled for the workspace

VS Code / OS

  • VS Code Version: 1.74.3
  • OS Version: Windows 10 Pro, 64-Bit

Steps to Reproduce

Create a HTML file with the following content:

<script>
/* --> */
</script>

🙁 Actual behavior

Console shows 2 problems:

  • Expression expected.
  • Unterminated regular expression literal.

Full errors:

[{
"resource": "test.html",
"owner": "generated_diagnostic_collection_name#1",
"severity": 8,
"message": "Expression expected.",
"source": "javascript",
"startLineNumber": 2,
"startColumn": 8,
"endLineNumber": 2,
"endColumn": 9
}]

[{
"resource": "test.html",
"owner": "generated_diagnostic_collection_name#1",
"severity": 8,
"message": "Unterminated regular expression literal.",
"source": "javascript",
"startLineNumber": 2,
"startColumn": 10,
"endLineNumber": 2,
"endColumn": 10
}]


It even shows more errors for every pair of -- within the comment block.

e.g.

<script>
/* --> ----------------------------- */
</script>

Results in a total of 16 errors logged (15 x expression expected, 1 x Unterminated regular expression literal.)

🙂 Expected behavior

Ignore whatever is in comments.

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