[Distutils] PEP 438 - Transition Phase 1

Donald Stufft donald at stufft.io
Mon May 20 08:21:05 CEST 2013

On May 20, 2013, at 2:18 AM, Lennart Regebro <regebro at gmail.com> wrote:

> On Sun, May 19, 2013 at 10:20 PM, Donald Stufft <donald at stufft.io> wrote:
>> Hrm, ZPT doesn't seem to be stripping the CDATA or unescaping the strings?
>> https://gist.github.com/dstufft/5608838 is what i have in the template file and that appears verbatim in the output?
> Yes? It will escape *data* inserted into the template (unless told not
> to), but what is in the template will appear in the output unescaped.
> I'm not sure how any template system can work otherwise, but perhaps
> I've been using Zope too long. :-)
> //Lennart

Maybe you can tell me what I'm doing wrong?

I need to insert a <script> tag with Javascript in it. Tres told me to put the contents of the script tag in CDATA blocks which I did, and then when the template was rendered it still had the CDATA blocks so it was invalid javascript.

He also said to just put the javascript in the body of the script but xml escape it. Which I did, and when the template was rendered the data was still xml escaped and again invalid javascript.

Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130520/d94a3b52/attachment-0001.pgp>

More information about the Distutils-SIG mailing list