Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: default_escape for Template::Toolkit?

by pc88mxer (Vicar)
on Apr 15, 2008 at 17:25 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://680585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found