stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.34k stars 221 forks source link

Allow using new lines inside tags #202

Closed ilyapuchka closed 6 years ago

ilyapuchka commented 6 years ago

To make templates more readable this allows using new lines in tags (anywhere where spaces are allowed), which can be useful when dealing with really long conditions to break them into several lines.

        There are {{ articles.count }} articles.

        {% for article in articles 
                          where 
                          article.length > 100 and
                          article.author.name and
                          article.comments.count > 0
        %}    - {{ article.title }} by {{ article.author }}.
        {% endfor %}