html - 如何让 IntelliJ IDEA 保持 HTML 嵌套选项卡?

当我格式化文档时,而不是保持原来的制表结构:

<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 打破了它:

如何关闭这种行为?

最佳答案

查看代码样式、Html 下的设置,然后在“其他”选项卡下:

您应该检查 Do not indent children of: 条目。你可能想玩这些东西,直到你得到你想要的风格。如果仍然无法正常工作,那么可能您的文档不符合 xhtml 标准——也就是说,它可能不平衡,虽然是合法的 html,但 Idea 难以格式化。

https://stackoverflow.com/questions/23289499/

相关文章:

list - VIM 中的格式化列表

c# - 如果语句突然被 Visual Studio 2010 在下一行格式化

scala - Intellij Scala 多种导入样式格式设置

android - 对话框中忽略的 Html 格式标记

iphone - NSDictionary `description` 格式化问题 - 将结构视为

c# - 使用 string.format 和 List.Count() 进行动态字符串格式化

python - 我们应该为 python 变量名使用哪些缩写?

c++ - 你如何设置 cout 语言环境来插入逗号作为千位分隔符?

android - Eclipse AndroidManifest.xml 格式

excel - 如何通过VBA代码获取Excel 2012条件格式的色标制作的颜色