Microsoft/vscode

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

Open

#213,628 创建于 2024年5月28日

在 GitHub 查看
 (1 评论) (0 反应) (1 负责人)TypeScript (10,221 fork)batch import
bughelp wantedhtml

仓库指标

Star
 (74,848 star)
PR 合并指标
 (平均合并 11小时 43分钟) (30 天内合并 1,000 个 PR)

描述

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

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.

贡献者指南