Formatting HTML is not working anymore

Since a few days ago, I get a message that the code is already properly formatted, no matter how badly formatted it is.
Screenshot attached. I have everything set in code style->html - nothing has changed and it used to work.
All other filetypes format correct.
format-html.png

1
12 comments

4 years later this is stil a helpful thread! In my case, a plugin (which adds support for a certain templating language) hijacked the .html extension. After re-assigning *.html to the HTML file type, everything was OK again.

1

What IDE version do you use? Please also make sure that Keep white spaces option is not enabled in Settings | Editor | Code Style | HTML | Other

1

Invalidating the caches didn't help.
The file is just a .html file... Does it have to be associated still?

0

Yes - with 'HTML' file type...
Sample project that shows up your issue + your idea.log might be helpful

0

Svelte HTML Components hijacked the .html extension

Instructions to modify file type registrations:

https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html

0

Please Isn't there a solution to this issue It's still bugging me!!

0

Oh Thank You Elena, after not enabling the above setting the formatting is working as expected. THANK YOU!

0

having the same issue. it just does not reformat the code.

code style settings:

0

"Auto-Indent Lines" seems to be working but it does not auto indent when executing "Reformat Code"

is that expected? if yes, how can i get "Auto-Indent Lines" into a save action?

0

Please share a video recording of the issue plus the idea.log

0

Settings > Editor > Code Style > HTML > Other > delete everything from “Do not indent children of:”

0

Are your files associated with HTML file type? Also, please try invalidating caches - does the problem persist?

-1

Please sign in to leave a comment.