#773 enhancement
T.J. Crowder

Template - option to escape HTML

Reported by T.J. Crowder | August 24th, 2009 @ 10:02 AM | in 1.7

A common use case I run into with Templates is that I want the replacement text to be run through escapeHTML.

It turns out to be trivially easy to extend the syntax (and code) of Template to optionally allow this; here's a mod in an experimental branch (with updated inline doc for explanation):
http://github.com/tjcrowder/prototype/commit/29b76e7a9e9c6168d62f1d...

In that implementation, I used an asterisk to flag up the substitutions I want escaped.

Thoughts? Perhaps for 1.6.2, 1.7, 2.0... If you like it, I'll integrate my tests for it into the unit test stuff with a follow-up commit.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages