Skip to content

[html] problems with html style comments in embedded code #47448

Description

@Jack-Punter

Issue Type: Bug

I have some computer generated HTML with some inline javascript and within the javascript, the code has generated HTML style comments, if I then format the file using Format Document (Shift+Alt+F) the formatter adds a space between the < and ! causing the file to error when attempting to load in a browser. I understand if you don't fix this as really you shouldn't use HTML style comments in your javascript. I have attached 2 files, one before and one after formatting, of a trivial example case. (rename these to .html)
Issue Broken.txt
Issue Working.txt

VS Code version: Code 1.22.1 (950b8b0, 2018-04-06T02:26:57.615Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz (4 x 3100)
Memory (System) 15.94GB (6.55GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe C:\Users\Jack\Desktop\PUBGAPI
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
gotemplate cas 0.2.0
Go luk 0.6.78
python ms- 2018.3.1

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitieshtmlHTML support issuesinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions