On Wed, Jul 14, 2010 at 10:18 AM, Martin Stein <[email protected]> wrote: > Hi all, > > I've noticed that the pylons trunk template defaults to using the > escape function from markupsafe now (previously from webhelpers.html) > > I think the move to markupsafe is great (fast c-extension), but the > two filters escape None differently: > >>>> import webhelpers.html, markupsafe >>>> webhelpers.html.escape(None) > literal(u'') >>>> markupsafe.escape(None) > Markup(u'None') > > Is this intentional? Is there a way to keep the None -> empty-string > escaping without plugging in a custom filter?
This is tricky. I asked Armin to change it upstream but he said it would break compatibility with normal string semantics (which he wants to emulate) and Jinja2 (where MarkupSafe came from). This means the C speedup will still have to go through a Python wrapper. -- 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.
