Skip to content

[html] Formatting Breaks with Space Between Commented Lines in Script Tag #213628

@mortonmills

Description

@mortonmills

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: Code 1.89.0 (b58957e, 2024-05-01T02:08:25.066Z)
  • OS Version: Linux x64 6.5.0-18-generic

When commenting out sections in a script tag,
the HTML formatting breaks
if there is a line with at least 1 space in between 2 commented out lines.
( Highlighting the following code block may help clarify. )

<script>
    //
 
    //
             </script>

Steps to Reproduce:

  1. Copy and paste the code block shown above into a blank HTML file in vscode.
  2. Format the HTML using the Format Document command ( keyboard shortcut is usually Ctrl + Shift + I ) .
  3. Document will not format
  4. Remove the single space ( not the line ) between the 2 commented out lines.
  5. Format HTML using same method as Step 2.
  6. Document should be formatted.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitieshtmlHTML support issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions