On Thu, Jun 28, 2012 at 10:52 AM, Jeremy Dunck <jdu...@gmail.com> wrote: > > On Jun 28, 2012, at 6:57 AM, Luke Plant <l.plant...@cantab.net> wrote: > > > Hi all, > > > > 2) Any better name than 'html_fragment'? > > > > I like the general approach, but I miss the security-minded namse of > "escape" and "mark safe". Maybe "safe_html_fragment" or > "make_safe_html_fragment"? Getting annoyingly long, I know. > > (Apologies if this feels bike shedding) >
It's not just bikeshedding. The "safe" word is a good indicator that the mark_safe utility function has been used throughout. In fact, given the tight relationship of the two, I might even suggest a name like "html_mark_safe," which strongly suggests "mark_safe with an html format string." Also, to be compatible with python 3 and more idiomatic python, I would implement the function as: def html_mark_safe(format_string, *args): return mark_safe(format_string.format(*map(conditional_escape, args))) Best, Alex Ogier -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.