Skip to content

Commit af23920

Browse files
committed
Added new template filter 'textify' which changes </b> and </i> tags to '*' and '/' instead
- Legacy-Id: 4638
1 parent aa65e63 commit af23920

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

ietf/idtracker/templatetags/ietf_filters.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,13 @@ def user_roles_json(user):
466466
roles[g.name] = True
467467
return mark_safe(simplejson.dumps(roles))
468468

469+
@register.filter
470+
def textify(text):
471+
text = re.sub("</?b>", "*", text)
472+
text = re.sub("</?i>", "/", text)
473+
# There are probably additional conversions we should apply here
474+
return text
475+
469476
def _test():
470477
import doctest
471478
doctest.testmod()

0 commit comments

Comments
 (0)