Modifier: collapse_whitespace


Trims a string and replaces consecutive whitespace characters with a single space. This includes tabs and newline characters, as well as multibyte whitespace such as the thin space and ideographic space.

title: Bad   at           typing
{{ title | collapse_whitespace }}
Bad at typing

Additional Reading

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

Last modified on March 31, 2016