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
This commit is contained in:
Henrik Levkowetz 2012-11-25 15:56:29 +00:00
parent 9a302b63dc
commit dde89d19f4

View file

@ -71,6 +71,12 @@ def parse_email_list(value):
else:
return value
@register.filter(name='fix_angle_quotes')
def fix_angle_quotes(value):
if "<" in value:
value = re.sub("<([\w\-\.]+@[\w\-\.]+)>", "&lt;\1&gt;", value)
return value
# there's an "ahref -> a href" in GEN_UTIL
# but let's wait until we understand what that's for.
@register.filter(name='make_one_per_line')