#2193: Mako 'h' filter is mangled by turbogears default template variables
------------------------+---------------------------------------------------
Reporter: kikidonk | Owner: faide
Type: defect | Status: new
Priority: normal | Milestone: 2.0b6
Component: TurboGears | Version: trunk
Severity: normal | Keywords:
------------------------+---------------------------------------------------
The mako documentation about filtering:
http://www.makotemplates.org/docs/filtering.html
In theory you're supposed to be able to do {{{${something | h}}}} to have
the content of the template variable 'something' html-escaped in a mako
template.
However at http://trac.turbogears.org/browser/trunk/tg/render.py#L99 a
default variable is passed to the template that is also named 'h' which
will override the mako builtin filter 'h' resulting in a weird exception
when using it. This is somewhat unexpected.
I know that in the configuration, turbogears setup a default html-escape
filter for mako, so in theory the 'h' filter shouldn't be needed but there
are some cases where one would want manual control on things (ie. prevent
escape then escape a subset of the string or such) and to do that one has
to use the 'escape' function exported by TG.
I don't know what could be a correct solution here..
--
Ticket URL: <http://trac.turbogears.org/ticket/2193>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---