From 41ae03b37b1d7f7cd13fa1800d3aed58e5a09a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Tue, 20 Nov 2018 14:57:01 +0100 Subject: [PATCH 1/2] Fix splitter detection bug #178 See https://github.com/mailgun/talon/issues/178 --- talon/quotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talon/quotations.py b/talon/quotations.py index 8b368e59..5dfde97b 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -25,7 +25,7 @@ RE_FWD = re.compile("^[-]+[ ]*Forwarded message[ ]*[-]+$", re.I | re.M) RE_ON_DATE_SMB_WROTE = re.compile( - u'(-*[>]?[ ]?({0})[ ].*({1})(.*\n){{0,2}}.*({2}):?-*)'.format( + u'(-*[>]?[ ]?({0})[ ].*({1})(.*\n){{0,2}}.*\s({2}):?-*)'.format( # Beginning of the line u'|'.join(( # English From f0791c9004dc22afbcc2b06b1a869ae0f6f80647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Tue, 27 Nov 2018 13:23:44 +0100 Subject: [PATCH 2/2] Fix broken unit tests The 'wrote' token is not necessarily preceeded by a space, the email address enclosed inside brackets can also be present: "wrote:" Fix the broken test by allowing either a space ('\s') or a closing bracket ('>') --- talon/quotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talon/quotations.py b/talon/quotations.py index 5dfde97b..b9319270 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -25,7 +25,7 @@ RE_FWD = re.compile("^[-]+[ ]*Forwarded message[ ]*[-]+$", re.I | re.M) RE_ON_DATE_SMB_WROTE = re.compile( - u'(-*[>]?[ ]?({0})[ ].*({1})(.*\n){{0,2}}.*\s({2}):?-*)'.format( + u'(-*[>]?[ ]?({0})[ ].*({1})(.*\n){{0,2}}.*[\s>]({2}):?-*)'.format( # Beginning of the line u'|'.join(( # English