From a0644d225c055c9e442ba6f6882f4560253dd519 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 22 Nov 2016 15:48:03 -0500 Subject: [PATCH] Only check for reply markers at the beginning of each line Otherwise we could cut the user's message if they use the ">" symbol in their text. Signed-off-by: Anna Schumaker --- slackpost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slackpost.py b/slackpost.py index d487d1f..a054c95 100755 --- a/slackpost.py +++ b/slackpost.py @@ -52,7 +52,7 @@ thread_id = match.group(0).rsplit("=")[-1].rstrip() # - Quoted text will always begin with ">" # - The email reply will always have "Reply sent on " text # -message = re.sub(">(.*?)\n", "", payload).rstrip() +message = re.sub("^>(.*?)\n", "", payload, flags=re.MULTILINE).rstrip() split = message.split("\n") message = "\n".join(split[:-1]).rstrip()