File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,12 @@ def read(text)
8888 text . gsub! $1, $1. gsub ( "\n " , " " )
8989 end
9090
91+ # Check for Windows Live multi-line reply headers.
92+ if text =~ /^(From:\s .+?Subject:.+?)$/m
93+ text . gsub! $1, $1. gsub ( "\n " , " " )
94+ end
95+
96+
9197 # Some users may reply directly above a line of underscores.
9298 # In order to ensure that these fragments are split correctly,
9399 # make sure that all lines of underscores are preceded by
@@ -188,7 +194,7 @@ def scan_line(line)
188194 #
189195 # Returns true if the line is a valid header, or false.
190196 def quote_header? ( line )
191- line =~ /^:etorw.*nO$/
197+ line =~ /^:etorw.*nO$/ || line =~ /^.*:(morF|tneS|oT|tcejbuS)$/
192198 end
193199
194200 # Builds the fragment string and reverses it, after all lines have been
Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ def test_parse_out_just_top_for_outlook_with_reply_directly_above_line
160160 assert_equal "Outlook with a reply directly above line" , EmailReplyParser . parse_reply ( body )
161161 end
162162
163+ def test_parse_out_just_top_for_outlook_with_no_line
164+ body = IO . read EMAIL_FIXTURE_PATH . join ( "email_2_3.txt" ) . to_s
165+ assert_equal "Outlook with a reply directly above line" , EmailReplyParser . parse_reply ( body )
166+ end
167+
163168 def test_parse_out_sent_from_iPhone
164169 body = IO . read EMAIL_FIXTURE_PATH . join ( "email_iPhone.txt" ) . to_s
165170 assert_equal "Here is another email" , EmailReplyParser . parse_reply ( body )
Original file line number Diff line number Diff line change 1+ Outlook with a reply directly above line
2+
3+ From: CRM Comments [crm-comment@example.com]
4+ Sent: Friday, 23 March 2012 5:08 p.m.
5+ To: John S. Greene
6+ Subject: [contact:106] John Greene
7+
8+ > A new comment has been added to the Contact named 'John Greene':
9+ >
10+ > I am replying to a comment.
You can’t perform that action at this time.
0 commit comments