Is there a mechanism in Mako templates that would allow me to remove extra spaces from the template output, similar to Django’s {% spaceless %} tag?
Is there a mechanism in Mako templates that would allow me to remove extra
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are some clues here, but basically it doesn’t look like it’s supported under Mako directly.
I do want to point out, however that Jinja2 does support whitespace removal via the {%- and -%} opening and closing tags. It is very easy to use under Pyramid via:
From that point forward you can just use the .jinja2 file extension and build your templates.
Anyway, sorry I couldn’t give you better news!