[Templates] CHOMP feature request

Andy Wardley abw@wardley.org
Thu, 25 May 2006 10:10:15 +0100


mail@seamons.com wrote:
> So - I went ahead and coded up the added chomp capabilities.  These diffs are 
> taken against the 2.14 release that is on CPAN (and may not be compatible 
> with HEAD).

Applied (eventually!).  Many thanks Paul.

We now have CHOMP_GREEDY (or '~') to greedily chomp all whitespace 
including multiple newlines.

CHOMP_COLLAPSE (or '=') now does the same thing (chomping multiple 
newlines greedily) but replaces it with a single space.  Previously it 
only chomped a single line.

CHOMP_ONE is the new name for what used to be CHOMP_ALL.  The behaviour 
remains unchanged.  The CHOMP_ALL constant is still supported for 
backwards compatibility but will eventually be deprecated (or possibly 
re-used as a better name for CHOMP_GREEDY, but not until TT3).

Changes in CVS.  Version 2.15 coming soon.

A