You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/01/09 00:55:19 UTC

[kibble-scanners] branch master updated: better quote removal

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git


The following commit(s) were added to refs/heads/master by this push:
     new 31eb19d  better quote removal
31eb19d is described below

commit 31eb19dc62d12c3e88d06a9f25ccc08ad3bc97f7
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Jan 9 01:55:07 2018 +0100

    better quote removal
---
 src/plugins/utils/kpe.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/utils/kpe.py b/src/plugins/utils/kpe.py
index 0390100..0988be5 100644
--- a/src/plugins/utils/kpe.py
+++ b/src/plugins/utils/kpe.py
@@ -45,7 +45,7 @@ import uuid
 def trimBody(body):
     """ Quick function for trimming away the fat from emails """
     # Cut away "On $date, jane doe wrote: " kind of texts
-    body = re.sub(r"((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+", "", body, flags = re.I | re.M)
+    body = re.sub(r"(((?:\r?\n|^)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]*[^\r\n]*\r?\n[^\n]*\n*)+)+)+)", "", body, flags = re.I | re.M)
     
     # Crop out quotes
     lines = body.split("\n")

-- 
To stop receiving notification emails like this one, please contact
['"commits@kibble.apache.org" <co...@kibble.apache.org>'].