[ZPT] escaping chars in tal

Evan Simpson evan@digicool.com
Wed, 23 May 2001 09:31:38 -0400


From: "Thomas Olsen" <thomas@iconmedialab.dk>
> tal:attributes="content python:('%s; URL=%s' % (here.refreshrate,
here.absolute_url()))"
[snip]
> Every time there is a semi colon [I get an error]

This is a rare and therefore somewhat obscure effect of tal:define and
tal:attributes allowing multiple parts.  Since the parts are separated by
semicolons, any semicolon appearing in an expression must be quoted by
doubling it.  Thus:

tal:attributes="content python:('%s;; URL=%s' % (here.refreshrate,
here.absolute_url()))"

Cheers,

Evan @ digicool