diff --git a/lib/email_reply_parser.rb b/lib/email_reply_parser.rb index 8be2a49..519c089 100644 --- a/lib/email_reply_parser.rb +++ b/lib/email_reply_parser.rb @@ -133,7 +133,7 @@ def read(text) private EMPTY = "".freeze - SIGNATURE = '(?m)^(--|__|\w-$)|(^(\w+\s*){1,3} ym morf tneS$)' + SIGNATURE = '(?m)(--\s*$|__\s*$|\w-$)|(^(\w+\s*){1,3} ym morf tneS$)' begin require 're2' @@ -152,7 +152,7 @@ def read(text) # Returns nothing. def scan_line(line) line.chomp!("\n") - line.lstrip! unless SIG_REGEX.match(line) + line.lstrip! unless SIG_REGEX.match(line) # We're looking for leading `>`'s to see if this line is part of a # quoted Fragment.