VS Code stopped formatting existing HTML file created before. New HTML file can be formatted

Viewed 29

My problem is VS code stopped formatting an existing HTML file when I press the hotkey. However if I create a new HTML file I can format the file easily. I have a problem with HTML files that I worked on before, that I was able to format easily, then after pushing to GitHub the HTML file stopped formatting, I am not sure if those two events are related. I tried to format the HTML file by creating a paragraph, screenshot is below.

Screen from VS code

I tried several things to solve the problem

  1. Restarted VS code
  2. Tried to format by using command pallete then chose format document with, then chose Prettier
  3. Pressed Prettier in the bottom part of the VS code to see problems - no problems
  4. If I create a new HTML file I can format it, but I can't format existing files

Please help if you know how to fix this problem! I am new to programming and I tried to google it, and watch videos but I couldn't find the solution. If possible please write steps on how to fix this issue.

1 Answers

The problem is fixed. I made a mistake in tags, so be very very careful and check your tags on html file that you are working on. The problem was that I did incorrect order of the and tags. That's why VS code wasn't able to format the HTML file. So guys if you have same problem just, recheck the tags! It might help!

Related