mercurial/templatefilters.py
changeset 16235 eb39bbda167b
parent 15155 f4a8d754cd0a
child 16251 db68ee3289b6
--- a/mercurial/templatefilters.py	Thu Mar 08 15:59:44 2012 -0600
+++ b/mercurial/templatefilters.py	Tue Mar 06 23:23:30 2012 +0100
@@ -242,12 +242,14 @@
     return "-rw-r--r--"
 
 def person(author):
-    """:person: Any text. Returns the text before an email address."""
+    """:person: Any text. Returns the name before an email address,
+    interpreting it as per RFC 5322.
+    """
     if not '@' in author:
         return author
     f = author.find('<')
     if f != -1:
-        return author[:f].rstrip()
+        return author[:f].strip(' "').replace('\\"', '"')
     f = author.find('@')
     return author[:f].replace('.', ' ')