microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.99k stars 29.54k forks source link

[html] "Auto Closing Tags" adds unnecessary tags in some cases with prettier-vscode #137938

Open tatsuyah opened 3 years ago

tatsuyah commented 3 years ago

Does this issue occur when all extensions are disabled?: No(with prettier-vscode)

Steps to Reproduce:

  1. install prettier-vscode v9.0.0
  2. Follow "Steps To Reproduce" section in this link. https://github.com/prettier/prettier-vscode/issues/2127

As explained in the above link, "HTML: Auto Closing Tags" settings adds unnecessary tags in some cases with prettier-vscode's html formetter.

In this case, I confirmed prettier-vscode returns right value to vs code via vscode.languages.registerDocumentFormattingEditProvider. And you can see more detailed discussion in the above issue's link.

aeschli commented 1 year ago

Still a problem:

<!DOCTYPE html>
<html lang="en">
  <body>
    <a class="footer-link" href="https://google.com"
      > Words words words words words words words words words words </a
    >
  </body>
</html>

format with prettier