[Templates] Chomp Directive?
Josh Rosenbaum
josh@infogears.com
Thu, 22 Mar 2007 12:59:46 -0600
Randal L. Schwartz wrote:
>>>>>> "Josh" == Josh Rosenbaum <josh@infogears.com> writes:
>
> Josh> It would be nice to have a tag to control the chomping method in TT similar to
> Josh> the TAGS directive. (ie: [% TAGS <! !> %])
>
> Josh> I'm thinking:
> Josh> [% PRE_CHOMP CHOMP_NONE %]
> Josh> [% POST_CHOMP CHOMP_ALL %]
>
> Josh> or maybe:
> Josh> [% CHOMP CHOMP_NONE CHOMP_ALL %]
> Josh> or:
> Josh> [% CHOMP NONE ALL %]
>
> You *do* know about + and - at the beginning and ending right? I've
> never wanted or needed more than that.
Yep, but if I or a customer wants to override it for every single line it becomes a pain to have to type: [%- -%] or [%+ +%]
This becomes an issue mainly when you are processing html vs text without knowing before hand what is coming up.
It doesn't happen a lot, but I think it sure would be nice to be able to override the behavior when it does happen. (If it is an easy enough patch, which I haven't looked at yet. Just gathering others' thoughts on the subject first.)
-- Josh