[htmltmpl] Two types of 'ESCAPE' for one item
Brought to you by:
samtregar
From: Alex K. <ka...@ra...> - 2004-11-30 17:02:58
|
Good day to all. I'd like to have such a code in my template: <a href="javascript:func('<TMPL_VAR NAME="email">')">add email</a> I even already do so :) It seems to me that I need _both_ ESCAPE="HTML" and ESCAPE="JS" here to make it work with real data because that 'email' param could easily contain something like q{'John Doe' <jo...@do...>} and break on either apostroph or less-than whichever way of ESCAPing we use. Is there an elegant method of dealing with such data? I can certainly pre-JS-escape in Perl and then use ESCAPE="HTML" in template but that would look ugly. Or am I trying to solve a non-existent problem? -- Alex Kapranoff, #!/usr/bin/perl -w $SIG{__WARN__}=sub{print substr("@_",-43+ord$_,1)for '6.823O1US90:350:739OJ;0:*'=~m}.}g},$}='PJlshrk';reset$}+43; |