htacg / tidy-html5

The granddaddy of HTML tools, with support for modern standards
http://www.html-tidy.org
2.7k stars 414 forks source link

option "--indent-with-tabs yes" does NOT work as expected #1107

Open el-schalo opened 7 months ago

el-schalo commented 7 months ago

The option "indent-with-tabs" always inserts exactly ONE tab character (\t) before each line, instead of as many tabs as would correspond to the indentation level.

expected result:

<server xmlns="urn:jboss:domain:11.0">
    <extensions>
        <extension module="org.jboss.as.clustering.infinispan"/>
    </extensions>
    <management>
        <security-realms>
            <security-realm name="ManagementRealm">
                <authentication>
                    <local default-user="$local" skip-group-loading="true"/>
                    <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
                </authentication>
                <authorization map-groups-to-roles="false">
                    <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
                </authorization>
            </security-realm>
            <security-realm name="ApplicationRealm">
                <server-identities>
                    <ssl>
                        <keystore generate-self-signed-certificate-host="localhost"/>
                    </ssl>

actual result:

<server xmlns="urn:jboss:domain:11.0">
    <extensions>
    <extension module="org.jboss.as.clustering.infinispan" />
    </extensions>
    <management>
    <security-realms>
    <security-realm name="ManagementRealm">
    <authentication>
    <local default-user="$local" skip-group-loading="true" />
    <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" />
    </authentication>
    <authorization map-groups-to-roles="false">
    <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir" />
    </authorization>
    </security-realm>
    <security-realm name="ApplicationRealm">
    <server-identities>
    <ssl>
    <keystore generate-self-signed-certificate-host="localhost" />
    </ssl>
donparakin commented 2 months ago

@el-schalo , I ran into the same problem. By chance I stumbled across setting "indent-spaces" to 12 as well as "indent-with-tabs" to "yes" and I got closer to the desired result: indented with tabs up to 12 levels deep ... but, strangely, sometimes it adds two more tabs for the next level. At least it's better than with "indent-spaces" = 1.