If you’re doing web development and generating HTML, you normally don’t worry about whitespace. But there are other situations where it’s critical to control where whitespace – particularly linebreaks – occur.
At its defaults, Fluid only deals with bracketed elements. It either executes those expressions ({%..%}
) or replaces them with data {{..}}
. Anything outside of the tags is left alone.
This means that if you format your code using line breaks and indentation, that whitespace remains after the code is executed. We often create whitespace to help source code make sense. Imagine instantly removing all the tags from a template, and a lot of the whitespace just doesn’t make sense anymore.
Consider this template: