Anyone got an idea for who to work round quotes not being escaped in TAL? I've got a line: <input tal:attributes="value here/mystring" /> mystring may contain a quote that needs to be escaped to " It's not automatically escaped by the TAL engine, unfortunately if I write code to escape it myself then I end up with " because although TAL fails to escape " it does escape &! Also, I can't turn escaping off completely with structure as that doesn't work with attributes. I put this in the Collector but I really need something sooner. Thanks for any ideas. Andrew
Andrew Veitch wrote at 2004-3-12 23:10 +0000:
<input tal:attributes="value here/mystring" />
mystring may contain a quote that needs to be escaped to "
It's not automatically escaped by the TAL engine, unfortunately if I write code to escape it myself then I end up with " because although TAL fails to escape " it does escape &!
I cannot reproduce your problem in my Zope 2.7.0. Especially, I tried '<a href="abc" tal:attributes="title python:'\x22'">abc</a>' and correctly got '<a href="abc" title=""">abc</a>' -- Dieter
<input tal:attributes="value here/mystring" />
mystring may contain a quote that needs to be escaped to "
I cannot reproduce your problem in my Zope 2.7.0.
Thanks (once again!) Dieter. I've checked again and it turns out this was fixed in Zope 2.7.0 beta 4, I was using an older 2.7. Andrew
participants (2)
-
Andrew Veitch -
Dieter Maurer