Skip to content

Commit dde89d1

Browse files
committed
Added a filter for use in displaying document comments and discusses which unfortunately sometimes use html <br> markup, which should give line breaks, and sometimes contain <email@domain> which should *not* be interpreted as html, but rendered as &lt;...
- Legacy-Id: 5075
1 parent 9a302b6 commit dde89d1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ietf/idtracker/templatetags/ietf_filters.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ def parse_email_list(value):
7171
else:
7272
return value
7373

74+
@register.filter(name='fix_angle_quotes')
75+
def fix_angle_quotes(value):
76+
if "<" in value:
77+
value = re.sub("<([\w\-\.]+@[\w\-\.]+)>", "&lt;\1&gt;", value)
78+
return value
79+
7480
# there's an "ahref -> a href" in GEN_UTIL
7581
# but let's wait until we understand what that's for.
7682
@register.filter(name='make_one_per_line')

0 commit comments

Comments
 (0)