spaceless Tag



Removes irrelevant whitespace between HTML tags.


{% spaceless %}
  <small class="text-muted">
    Created on: {{ joke.created }}
    Last updated: {{ joke.updated }}
{% endspaceless %}


<p><small class="text-muted">
    Created on: 
    Last updated: 

Notice that the whitespace within the small element has not been removed. Only whitespace between successive opening tags and successive closing tags is removed.

Did we get something wrong? Is there a use case for the spaceless tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on Oct. 30, 2022, 1:22 p.m. EST