Skip to content

Commit ca6050c

Browse files
committed
Add a separator to handle '2013/12/15 Bob Example <[email protected]>'
Closes thoughtbot#103
1 parent d790151 commit ca6050c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/griddler/email_parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def self.regex_split_points
8484
/^\s*--\s*$/,
8585
/On.*wrote:/,
8686
/^\s*On.*\r?\n?\s*.*\s*wrote:$/,
87-
/From:.*$/i
87+
/From:.*$/i,
88+
/^\s*\d{4}\/\d{1,2}\/\d{1,2}\s.*\s<.*>?$/i
8889
]
8990
end
9091

spec/griddler/email_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,19 @@
177177
body_from_email(:text, body).should eq ''
178178
end
179179

180+
it 'handles "[date] [soandso] <email@example>" format' do
181+
body = <<-EOF
182+
2013/12/15 Bob Example <[email protected]>
183+
> Check out this report.
184+
>
185+
> It's pretty cool.
186+
>
187+
> Thanks, Tristan
188+
EOF
189+
190+
body_from_email(:text, body).should eq ''
191+
end
192+
180193
it 'handles "Reply ABOVE THIS LINE" format' do
181194
body = <<-EOF
182195
Hello.

0 commit comments

Comments
 (0)