From Freemarker manual as follows:
<#assign x = " moo \n\n ">
(<#compress>
1 2 3 4 5
${moo}
test only
I said, test only
<#compress>)
will output
(1 2 3 4 5
moo
test only
I said, test only)
http://freemarker.sourceforge.net/docs/ref_directive_compress.html