Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: default_escape for Template::Toolkit?

by pc88mxer (Vicar)
on Apr 15, 2008 at 17:25 UTC ( #680585=note: print w/ replies, xml ) Need Help??


in reply to default_escape for Template::Toolkit?

I created a patch for this about six months ago and discussed it on the TT mailing list. It allows you to write:

[% GETFILTER '::html_escape' %] ... all gets are now filtered through the function ::html_escape ... Hello, [% name %] [% GETFILTER '' %] ... turn off filtering ... [% END %] ... previous filtering resumes ... [% END %]
It maintains a stack of filters, and there's no reason why you couldn't pre-initialize it with a default filter.

At the time it seemed to generate some interest, although not enough for me to do much more with it. Perhaps by now some form of it has made it's way into the latest release - I haven't checked.


Comment on Re: default_escape for Template::Toolkit?
Download Code
Re^2: default_escape for Template::Toolkit?
by moritz (Cardinal) on Apr 15, 2008 at 17:34 UTC
    Perhaps by now some form of it has made it's way into the latest release - I haven't checked.

    I grepped the latest release for 'getfilter', no results. So it doesn't seem to be implemented, or at least not with that syntax. I didn't find anything in the Changes file either.

    Thanks for your response anyway.

      It's trivial to implement. Check out the TT mailing list archives for Nov 2007.

      I'm not sure why there wasn't more interest in it. I think this capability would be a great boon for creating robust HTML using TT.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://680585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-09-21 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls