Jetbrains PhpStorm HTML Indent

It looks like PHPStorm does not want to follow the specified code style. Each time I format an HTML file, it resets the indent from this:

<html> <head> bleh </head> <body> bleh </body> </html> 

to

 <html> <head> <bleh> bleh <bleh> </head> <body> <bleh> bleh <bleh> </body> </html> 

"bleh" (being all contained tags) retreat as they assume.
I found the setting: File -> Preferences -> Code Style -> HTML -> Other - "Do not back down from children."
This was filled with a few tags that I already deleted (so the text box is empty).
The settings are theoretically applied to the project scheme, which is the current scheme.
However, I did not fully understand the concept of what these schemes are, so I might miss something important.

Images:
http://snapshot.overloadproducts.com/7411c9d50e0b43edc76c1e625a38d61c http://snapshot.overloadproducts.com/5a74f83356572f3644a6d52bf2fa1f66

Edit: Opened PHPStorm the next day, and he said that the project file was edited externally and needed to be updated. As soon as this happened, it was formatted again.
So somehow the settings file was not synchronized, and the settings window was not saved in the file.
In my opinion, a mistake.

+7
html formatting phpstorm
source share
3 answers

Just go to Setting/preferences → Editor → Code Style → HTML → Other

Insert new line before: add body.

Do not step back from the children: clean everything in this form.

+16
source share

ANSWER (ON EDIT):. For real work, try right-clicking on your document and clicking "Paste Easy." This precedes the formatting of the text pasted onto the clipboard. In fact, this is not a solution, but an appropriate solution.

ORIGINAL:

Did you get the answer to this question?

I have the same problem, and for me life cannot fix it. This is really annoying, especially considering that the preview pane of how code formatting should look is not accurate - it shows:

 <div> <div> <p> Some comment from JetBrains. </p> </div> </div> 

... but when you paste text from the editor, it is reformatted to:

 <div> <div> <p> Some comment from JetBrains. </p> </div> </div> 

Sorry to post a comment in the answer section, but I don't have 15 reputation.

+3
source share

Directly below the option "Do not retreat from children:" you will find the option "or the tag size is larger" with a default value of 200.

This means that for large HTML files, indentation will be effectively disabled. I have no idea why anyone would want this, but the way to get rid of this (miss-) behavior is to delete this value (just leave the field blank).

+2
source share

All Articles