On Mon, Dec 1, 2008 at 8:28 PM, Mike Orr <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 1, 2008 at 6:53 PM, kettle <[EMAIL PROTECTED]> wrote:
>>> kettle wrote:
>>> > Hi, I have a quick question, I'm using the latest version of pylons,
>>> > and I'd like to return a chunk of html as a c.myvar style variable,
>>> > and then interpolate this into a template.
>>> > Building the variable value is fine, but the <, >, & etc. characters
>>> > always get escaped when the template pulls them in.  There must be a
>>> > way to override this behavior, no?  I realize that this is probably an
>>> > indication that said html chunk should be moved to the template, but
>>> > that is somewhat impractical at the moment.
>>> > Cheers
>>>
>>> I am not sure if this is the "correct" way or not but I do
>>> h.literal(c.myvar)
>
> You should also be able to do it as ${c.myvar | n}

Actually no, it's better to do it as c.myvar = literal(value) .  That
way the value is frozen when it's known to be safe HTML markup, and
then if it's combined with anything else the other stuff will be
escaped.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to