Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2862 closed enhancement (wontfix)

[patch] Make escape filter smarter

Reported by: SmileyChris Owned by: adrian
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:

Description

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 SmileyChris 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by SmileyChris

comment:1 Changed 9 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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