Skip to content

Commit 4052501

Browse files
committed
remove Unicode from email address @ and support https links
1 parent 4599716 commit 4052501

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

resume.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def sub(pattern, repl, string, **kwargs):
9393
def replace_links(line):
9494
line = re.sub(r"<([^:]+@[^:]+?)>", r"\href{mailto:\1}{\1}", line)
9595
line = re.sub(r"<(http.+?)>", r"\url{\1}", line)
96+
line = re.sub(r"<(https.+?)>", r"\url{\1}", line)
9697
return re.sub(r"\[([^\]]+)\]\(([^\)]+)\)", r"\href{\2}{\1}", line)
9798

9899
contact_lines = "\n\n".join(map(replace_links, contact_lines))
@@ -131,7 +132,7 @@ def html(lines, contact_lines, *args):
131132
for line in contact_lines:
132133
if '@' in line and '--no-gravatar' not in args:
133134
gravatar = GRAVATAR.format(
134-
hash=hashlib.md5(line.lower().strip('<>')).hexdigest())
135+
hash=hashlib.md5(line.lower().strip('<>').encode('utf-8')).hexdigest())
135136
break
136137
if gravatar is not None:
137138
contact_lines.insert(0, "<img src='{}' />".format(gravatar))

0 commit comments

Comments
 (0)