nmweb: Fix spacing around punctuation in headers

This commit is contained in:
Jakub Wilk 2022-10-11 10:19:44 +02:00 committed by David Bremner
parent 3db892f43b
commit 32bef33565
2 changed files with 3 additions and 3 deletions

View file

@ -125,7 +125,7 @@ def mailto_addrs(msg,header_name):
return ''
frm = email.utils.getaddresses([hdr])
return ','.join(['<a href="mailto:%s">%s</a> ' % ((l, p) if p else (l, l)) for (p, l) in frm])
return ', '.join(['<a href="mailto:%s">%s</a>' % ((l, p) if p else (l, l)) for (p, l) in frm])
env.globals['mailto_addrs'] = mailto_addrs
def link_msg(msg):

View file

@ -3,10 +3,10 @@
{% set headers = ['Subject', 'Date'] %}
{% set addr_headers = ['To', 'Cc', 'From'] %}
{% for header in headers: %}
<p><b>{{header}}:</b>{{m.header(header)|e}}</p>
<p><b>{{header}}:</b> {{m.header(header)|e}}</p>
{% endfor %}
{% for header in addr_headers: %}
<p><b>{{header}}:</b>{{mailto_addrs(m,header)|safe}}</p>
<p><b>{{header}}:</b> {{mailto_addrs(m,header)|safe}}</p>
{% endfor %}
<hr>
{% for part in format_message(m,mid): %}{{ part|safe }}{% endfor %}