Modifier: spaceless


Removes excess whitespace and line breaks from a string. A definite OCD pleaser.

html: |
    <p>I copy & pasted
        <a href="http://goodnightchrome.show">this link
        </a>   <strong>for you!</strong>    </p>
{{ html | spaceless }}
<p>I copy & pasted <a href="http://goodnightchrome.show">this link </a><strong>for you!</strong></p>

Additional Reading

Learn how to use and chain modifiers in the Antlers template guide.

Last modified on February 16, 2018