When i format document, instead of keeping original tabbing structure:
<div class="topbar">
<div class="topbar-wrapper">
<div class="js-topbar-dialog-corral">
<div class="topbar-dialog siteSwitcher-dialog dno">
</div>
</div>
</div>
</div>
IDEA breaks it:
How to turn off that behaviour?
If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. On the appropriate language page, on the Tabs and Indents tab, specify the appropriate indents options and click OK.
HTML IntelliJ IDEA brings powerful support for HTML that includes syntax and error highlighting, formatting according to the code style, structure validation, code completion, on-the-fly preview during a debugging session (Live Edit) or in the dedicated preview tab in the code editor, and much more.
IDEA has a “smart tabs” option that you can turn on: If this check box is selected, IntelliJ IDEA inserts tabs for indentation and reformatting, but fine alignment to a necessary column is done only via spaces. This is done in order to preserve visual representation of the source code, when the Tab Size is changed.
Take a look at your settings under Code Style, Html, then under the Other tab:
You should check the Do not indent children of:
entry. You may want to play with these things until you get the style that you want. If it still isn't working, then maybe your document isn't xhtml compliant -- that is, it may be unbalanced, which although legal html, makes it difficult for Idea to format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With