I use the Mako template system on my Pylons website and am having trouble removing spaces.
My reasoning for removing spaces is the generated HTML file, which is issued as 12363 lines of code. This, I suppose, is the reason Internet Explorer hangs when it tries to download it.
I want my HTML file to look nice and neat, so I can easily make changes to it, and the generated output looks as ugly and messy as required to reduce file size and memory usage.
The Mako documentation http://www.makotemplates.org/docs/filtering.html says you can use the flag trim, but that doesn't work. Code example:
<div id="content">
${next.body() | trim}
</div>
The only way I was able to split the lines of a newline is to add \(backslash) to the end of each line. This is pretty annoying when coding views, and I'd rather have a centralized solution.
How to remove spaces / newlines?
source
share