Keats / tera

A template engine for Rust based on Jinja2/Django
http://keats.github.io/tera/
MIT License
3.36k stars 280 forks source link

Removing space between HTML tags #912

Closed xpe closed 2 months ago

xpe commented 2 months ago

As is well known, space between inline HTML elements can affect rendering.

Below is one way to use Tera comments to manage this:

<nav>
    <ul>
        <li><a href="/">Home</a></li>{#
        #}<li><a href="/blog">Blog</a></li>{#
        #}<li><a href="/about">About</a></li>{#
        #}<li><a href="/contact">Contact</a></li>{#
    </ul>
</nav>

Does Tera provide any other mechanisms to help?

Keats commented 2 months ago

Nothing in particular as Tera is not HTML specific, you can use the same tricks as the article.