To avoid escaping, use the structure:
prefix:
<div>${structure: content}</div>
You can also pass an object with a __html__
method:
Note that if an object implements the
__html__
method, the result of this method will be inserted as-is (without XML escaping).
Update:
As requested, here is an example of how I think the __html__
method should work. Note that I'm not a Chameleon user and that this code untested :)
class Unescaped(object):
def __init__(self, value):
self.value = value
def __html__(self):
return self.value
In your template:
<div>${ Unescaped(content) }</div>