compress

Synopsis

[#compress]
  ...
[/#compress]

Description

The compress directive is useful for removing superfluous white-space when you use a white-space insensitive format (e.g., HTML or XML). It captures the output generated inside its body (i.e., between its start-tag and end-tag), and reduces all unbroken white-space sequences to a single white-space character. The inserted character will be a line break if the replaced sequence contains line breaks, or a space otherwise. The very first and very last unbroken white-space sequences will be completely removed.

[#set 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)  

Page generated: 2008-07-16 22:54:16 GMT FreeMarker Manual -- For FreeMarker 2.4pre1 - INCOMPLETE/OUTDATED!