On 2009-9-26 00:45, Iain Duncan wrote:
>
>> Hm, the chameleon.zpt template has not seen as much love as the
>> chameleon.genshi version so it might have broken somewhere. Can you test
>> if chameleon.genshi works for you? If so I'll look at fixing up the
>> chameleon.zpt version.
>
> I've got the genshi templates being rendered, but I don't seem to be
> able to use HTML() or XML() to unescape html tags if the values being
> injected into the template are xhtml. Can anyone tell me what I need to
> do to display HTML properly within a genshi template rendered by
> chameleon, or why the HMTL function is not available?
Same system as Mako uses: it checks for a __html__ method. If you use
pylons that means you can use webhelpers.html.literal to indicate a
string should not be escaped. For example:
from webhelpers.html import literal
def my_func_in_lib_helpers():
return literal(u"Hello, <em>world</em>!")
Wichert.
--
Wichert Akkerman <[email protected]> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---