Linkify the Author: fields with mailto urls.

This commit is contained in:
Barry Warsaw 2000-08-17 04:27:04 +00:00
parent 64677a1024
commit a9248810dc
1 changed files with 13 additions and 1 deletions

View File

@ -108,8 +108,20 @@ def fixfile(infile, outfile):
fo.write('</div>\n'
'<div class="header">\n<table border="0">\n')
for k, v in header:
if k.lower() == 'author':
mailtos = []
for addr in v.split():
if '@' in addr:
mailtos.append(
'<a href="mailto:%s?subject=PEP%%20%s">%s</a>' %
(addr, pep, addr))
else:
mailtos.append(addr)
v = ' '.join(mailtos)
else:
v = cgi.escape(v)
fo.write(" <tr><th align='right'>%s:</th><td>%s</td></tr>\n"
% (cgi.escape(k), cgi.escape(v)))
% (cgi.escape(k), v))
title = 0
fo.write("</table>\n</div>\n<hr />\n"
"<pre>")