Skip to content

Commit dc9c6af

Browse files
Making regexp less greedy
1 parent 34d9cb5 commit dc9c6af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/email_reply_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def read(text)
8484

8585
# Check for multi-line reply headers. Some clients break up
8686
# the "On DATE, NAME <EMAIL> wrote:" line into multiple lines.
87-
if text =~ /^(On\s(.+?)wrote:)$/nm
87+
if text =~ /^(?!On.*On\s.+?wrote:)(On\s(.+?)wrote:)$/nm
8888
# Remove all new lines from the reply header.
8989
text.gsub! $1, $1.gsub("\n", " ")
9090
end

0 commit comments

Comments
 (0)