id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 20650 Filter tag accepts escape filter as a parameter grzesiof@… nobody "The docs state that the `filter` tag doesn't work with safe or escape (https://docs.djangoproject.com/en/dev/ref/templates/builtins/#filter). But because of a bug in the code it does. This piece of the filter implementation is supposed to handle it: {{{ if getattr(func, '_decorated_function', func).__name__ in ('escape', 'safe'): raise TemplateSyntaxError }}} (https://github.com/django/django/blob/master/django/template/defaulttags.py#L668) But because of the way safe and escape are defined, the decorated name is matching the filter name only for safe: {{{ @register.filter(""escape"", is_safe=True) def escape_filter(value): @register.filter(is_safe=True) def safe(value): }}} https://github.com/django/django/blob/master/django/template/defaultfilters.py#L442 https://github.com/django/django/blob/master/django/template/defaultfilters.py#L400 Perhaps the easiest solution would be to alter the escape_filter definition." Bug closed Template system 1.5 Normal fixed bmispelon@… Accepted 1 0 0 0 1 0