Added a 'htmlfilters' tag library containing 'removetags'
- Legacy-Id: 12823
This commit is contained in:
parent
aeede944d1
commit
a1606e8f7d
17
ietf/utils/templatetags/htmlfilters.py
Normal file
17
ietf/utils/templatetags/htmlfilters.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright the IETF Trust 2017, All Rights Reserved
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.template.library import Library
|
||||
from django.template.defaultfilters import stringfilter
|
||||
|
||||
from ietf.utils.html import remove_tags
|
||||
|
||||
register = Library()
|
||||
|
||||
@register.filter(is_safe=True)
|
||||
@stringfilter
|
||||
def removetags(value, tags):
|
||||
"""Removes a space separated list of [X]HTML tags from the output."""
|
||||
return remove_tags(value, tags)
|
||||
|
Loading…
Reference in a new issue