From f0151eb4fd9568a96de69509004ad20534857954 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 27 Mar 2020 12:23:00 -0400 Subject: Add "email" to badtrailers Not sure if it makes more sense to switch to a "known trailers" scheme instead of keeping a list of what is clearly not a trailer. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index e61958a..df6fa23 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -594,7 +594,7 @@ class LoreMessage: # Do we have something that looks like a person-trailer? matches = re.findall(r'^\s*([\w-]+):[ \t]+(.*<\S+>)\s*$', self.body, re.MULTILINE) # These are commonly part of patch/commit metadata - badtrailers = ('from', 'author') + badtrailers = ('from', 'author', 'email') if matches: for tname, tvalue in matches: if tname.lower() not in badtrailers: @@ -683,8 +683,7 @@ class LoreMessage: @staticmethod def clean_header(hdrval): - uval = hdrval.replace('\n', ' ') - new_hdrval = re.sub(r'\s+', ' ', uval) + new_hdrval = re.sub(r'\n?\s+', ' ', str(hdrval)) return new_hdrval.strip() @staticmethod -- cgit v1.2.3