Hi,

No, the Template class has nothing built-in to do that. I suggested
adding something to do it years ago[1] (and even created a patch, link
in the ticket), but it never went anywhere. You might grab the patch
and look at it, I don't think the Template code's changed and it was
trivially easy. I eventually went further and just made it possible
for the template to call string methods if they didn't take args, but
I don't have a linkable patch for that.

[1] 
https://prototype.lighthouseapp.com/projects/8886/tickets/773-template-option-to-escape-html

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Sep 22, 10:07 pm, Chazza <[email protected]> wrote:
> Greetings All,
>
> Can a Template escape the HTML of an object's properties when it
> evaluates?  E.g.
>
> var tpl = new Template('<p>No HTML #{prop}.</p>');
>
> tpl.evaluate({prop: '2 < 3'}); // BAD! displays <p>No HTML 2 < 3</p>
>
> can this display: <p>No HTML 2 &lt; 3</p>
> ?
>
> Thanks for any pointers.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to