What if I don't even want a single space character?
I suppose I could write my own filter, or I could do it like this:
[% "The cat sat on the mat" FILTER remove('\s+') %]
(from the filters docpage)
Brian
-----Original Message-----
From: darren chamberlain [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 2:01 PM
To: [EMAIL PROTECTED]
Subject: Re: [Templates] Chomping whitespace
* Hann, Brian <[EMAIL PROTECTED]> [2002-09-18 14:46]:
> I know you can use [%- and -%] to chomp newlines without having to use
> PRE_CHOMP and POST_CHOMP, but is there a way to remove ALL whitespace
> before/after a directive without having to use configuration options?
Hm... Wrap everything with the collapse filter:
[% FILTER collapse %]
Your content here
[% END %]
See the Template::Filters perldoc.
collapse
"collapse" replaces any amount of whitespace with a
single space character. "collapse" uses Perl's defi-
nition of whitespace, which includes spaces, tabs,
carriage returns, newlines, and a few more esoteric
characters.
[% FILTER collapse %]
You'll love
it, it's a way
of life.
[% END %]
The output is nice and clean:
You'll love it, it's a way of life.
(darren)
--
Those who learn from history are doomed to have it repeated to
them anyway.
-- Larry Wall
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates