Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2862 closed enhancement (wontfix)

[patch] Make escape filter smarter

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The following patch makes the escape filter (or technically, the escape function in django.utils.html) smarter so it can escape the items of lists, too.

Useful for this sort of thing:

{{ names_list|escape|join:'<br />' }}

Attachments (1)

better_escape.patch (1.7 KB) - added by Chris Beaven 10 years ago.

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by Chris Beaven

Attachment: better_escape.patch added

comment:1 Changed 10 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

This has been nixed in the past in favour of the auto-escaping proposal. See this thread on django-developers. I agree with Simon's logic in that thread.

If somebody really needs a slightly more powerful escape filter without the full auto-escape functionality, it can live outside of Django. We don't need multiple ways to achieve the same thing.

Note: See TracTickets for help on using tickets.
Back to Top