I'm a bit of a freak for clean lines, and something I've noticed while working with Antlers is the effect it has on indentation when HTML is rendered. For example:

navigation.html

{{ nav from="/" include_home="true" scope="tag" }}
    <ul class="nav navbar-nav">
        <li{{ if is_current or is_parent }} class="active"{{ /if }}>
            <a href="{{ url }}">{{ tag:nav_title or title }}</a>
        </li>
    </ul>
{{ /nav }}

Will output the following in source:

<div class="collapse navbar-collapse" id="nav-main">
                    <ul class="nav navbar-nav">
        <li class="active">
            <a href="/">Home</a>
        </li>
    </ul>
    ...

The ul class is indented ~3 times too many relative to the li element.

If I use the following instead in navigation.html (modified):

{{ nav from="/" include_home="true" scope="tag" }}

    <ul class="nav navbar-nav">
        <li{{ if is_current or is_parent }} class="active"{{ /if }}>
            <a href="{{ url }}">{{ tag:nav_title or title }}</a>
        </li>
    </ul>
{{ /nav }}

Or even:

{{ nav from="/" include_home="true" scope="tag" }}<ul class="nav navbar-nav">
        <li{{ if is_current or is_parent }} class="active"{{ /if }}>
            <a href="{{ url }}">{{ tag:nav_title or title }}</a>
        </li>
    </ul>
{{ /nav }}

That fixes the site's source output:

<div class="collapse navbar-collapse" id="nav-main">
    <ul class="nav navbar-nav">
        <li class="active">
            <a href="/">Home</a>
        </li>
    </ul>
    ...

But, in the first case there is now an empty space below the Antlers {{nav}} tag, and above the ul element (leading to an additional line space in source). In the second case, the formatting of the HTML template itself isn't exactly 'pretty'.

I'm not sure if this is intentional, or easily 'fixed' given the behaviour seems inherent to Antlers itself (much like a partial 'include' indenting the first line of the included file in source if the partial is indented - although this doesn't happen with all tags, e.g. {{ now format="Y" }} {{ author_name }} doesn't alter indentation in any way), but as someone who is obsessive over indentation, spacing, etc., it's a minor point of annoyance (though that's too strong a word).

Thanks!

Answered by Jack McDade! Go to answer.