Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/email_reply_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ def scan_line(line)
line.chomp!("\n")
line.lstrip! unless SIG_REGEX.match(line)

# We're looking for leading `>`'s to see if this line is part of a
# We're looking for a leading `>` to see if this line is part of a
# quoted Fragment.
is_quoted = !!(line =~ /(>+)$/)
is_quoted = !!(line =~ /(>)$/)

# Mark the current Fragment as a signature if the current line is empty
# and the Fragment starts with a common signature indicator.
Expand Down
7 changes: 7 additions & 0 deletions test/email_reply_parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'test/unit'
require 'pathname'
require 'pp'
require 'timeout'

dir = Pathname.new File.expand_path(File.dirname(__FILE__))
require dir + '..' + 'lib' + 'email_reply_parser'
Expand Down Expand Up @@ -222,6 +223,12 @@ def test_doesnt_remove_signature_delimiter_in_mid_line
assert_equal 1, reply.fragments.size
end

def test_long_quote_processing_completes
reply = Timeout.timeout(1) { email(:email_long_quote) }

assert_equal 5, reply.fragments.size
end

def email(name)
body = IO.read EMAIL_FIXTURE_PATH.join("#{name}.txt").to_s
EmailReplyParser.read body
Expand Down
16 changes: 16 additions & 0 deletions test/emails/email_long_quote.txt

Large diffs are not rendered by default.