Escape Single Quotes in Template Toolkit

Posted by Zach on Stack Overflow See other posts from Stack Overflow or by Zach
Published on 2010-06-07T15:09:16Z Indexed on 2010/06/07 15:12 UTC
Read the original article Hit count: 323

Filed under:
|

Do you ever escape single quotes in template toolkit for necessary javascript handlers? If so, how do you do it.

[% SET s = "A'B'C" %]

<a href="/abc.html" onclick="popup('[% s | html_entity %]')">ABC</a>

html_entity obviously doesn't work because it only handles the double quote. So how do you do it?

© Stack Overflow or respective owner

Related posts about perl

Related posts about template-toolkit