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.
Please sign in to leave a comment.
Are your files associated with HTML file type? Also, please try invalidating caches - does the problem persist?
Invalidating the caches didn't help.
The file is just a .html file... Does it have to be associated still?
Yes - with 'HTML' file type...
Sample project that shows up your issue + your idea.log might be helpful
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.
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
Please Isn't there a solution to this issue It's still bugging me!!
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
Oh Thank You Elena, after not enabling the above setting the formatting is working as expected. THANK YOU!
having the same issue. it just does not reformat the code.
code style settings:
"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?
Please share a video recording of the issue plus the idea.log
Settings > Editor > Code Style > HTML > Other > delete everything from “Do not indent children of:”