diff --git a/spec/fixtures/emails/email_18.html b/spec/fixtures/emails/email_18.html new file mode 100644 index 000000000..28feb051a --- /dev/null +++ b/spec/fixtures/emails/email_18.html @@ -0,0 +1,468 @@ + + + + + +

README:

+So this is an interesting test case. The email below looks like it failed quoted text detection. However, you can see that there is some plain text (the signature) at the bottom of the email after the blockquote. Unfortunately this looks arguably identical to someone who inline-replied to a message after a piece of quoted text. As such there's not a lot we can do about this until we can come up with an efficient way to inspect the bodies of previous messages. This is likely something that will have to happen server-side. +
Hi, +

+
+
TEXT
+

+
+
Regards,
+
FROM
+
+
+

+
+
On Thu, Mar 3, 2016 at 3:19 AM, Nylas <test@nylas.com> wrote:
+
+
Hey Recipient, +
+
+

+
+
+
Checking in -- will you guys be needing to test with 10+ accounts soon?
+ +
+

+
+
+
Best,
+
Nylas
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+

+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+On Feb 10 2016, at 3:28 am, Recipient Name <email.name@nylas.com> wrote: +
+
Fantastic! Thank you, Nylas. +
+

+
+
+
Have a good day,
+
Recipient
+
+
+

+
+
On Wed, Feb 10, 2016 at 1:27 AM, Test Sender <test@nylas.com> wrote:
+
+
Hi Recipient, +
+
+

+
+
+
CONTENT 4
+
+

+
+
+
CONTENT 5
+ +
+

+
+
+
Best,
+
Nylas
+
+

+
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+
num
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+On Feb 9 2016, at 12:49 am, Recipient Name <email.name@nylas.com> wrote: +
+
Hi Nylas, +
+

+
+
+
Content 1
+
+Content 2
+
+Regards,
+Recipient
+
+
+

+
+
On Tue, Feb 9, 2016 at 1:37 AM, Test Sender <test@nylas.com> wrote:
+
+
Thanks APerson! +
+
+

+
+
+
Content 3 +
+ +
+

+
+
+
Best,
+
Nylas
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+
num
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+On Feb 8 2016, at 3:33 pm, Another Person <another.email@nylas.com> wrote: +
+
CONTENT 8 +
+

+
+
+
Regards,
+
APerson
+
+

+
+
+
+
+
+
+
+
+
+
+
Another Person
+
Co-founder & President of Pipedrive
+ + + +
+
+
+
+
+
+
+
+
+
+
On Mon, Feb 8, 2016 at 2:27 PM, Test Sender <test@nylas.com> wrote:
+
+
Hi APerson, +
+
+

+
+
+
CONTENT 9
+
+

+
+
+
CONTENT 10
+
+

+
+
+
Best,
+
+

+
+
+
Nylas
+ +
+

+
+
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+
num
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+On Feb 8 2016, at 1:40 pm, Another Person <another.email@nylas.com> wrote: +
+
Hey Nylas, +
+

+
+
+
CONTENT 11
+
+

+
+
+
CONTENT 12
+
+
+
CONTENT 13
+
+

+
+CONTENT 14
+
+
+

+
+
+
CONTENT 15
+
+

+
+
+
Regards,
+
APerson 
+
+
+

+
+
+
+
+
+
+
+
+
+
+
Another Person
+
Co-founder & President of Place
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+--
+
+
+
+
Test Person
+
Product Manager | Pipedrive
+
@testtwitter
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+--
+
+
+
+
Test Person
+
Product Manager | Pipedrive
+
@testtwitter
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+--
+
+
+
+
Test Person
+
Product Manager | Pipedrive
+
@testtwitter
+
+
+
+
+ + diff --git a/spec/fixtures/emails/email_18_stripped.html b/spec/fixtures/emails/email_18_stripped.html new file mode 100644 index 000000000..6a082a391 --- /dev/null +++ b/spec/fixtures/emails/email_18_stripped.html @@ -0,0 +1,468 @@ + + + + +

README:

+So this is an interesting test case. The email below looks like it failed quoted text detection. However, you can see that there is some plain text (the signature) at the bottom of the email after the blockquote. Unfortunately this looks arguably identical to someone who inline-replied to a message after a piece of quoted text. As such there's not a lot we can do about this until we can come up with an efficient way to inspect the bodies of previous messages. This is likely something that will have to happen server-side. +
Hi, +

+
+
TEXT
+

+
+
Regards,
+
FROM
+
+
+

+
+
On Thu, Mar 3, 2016 at 3:19 AM, Nylas <test@nylas.com> wrote:
+
+
Hey Recipient, +
+
+

+
+
+
Checking in -- will you guys be needing to test with 10+ accounts soon?
+ +
+

+
+
+
Best,
+
Nylas
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+

+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+On Feb 10 2016, at 3:28 am, Recipient Name <email.name@nylas.com> wrote: +
+
Fantastic! Thank you, Nylas. +
+

+
+
+
Have a good day,
+
Recipient
+
+
+

+
+
On Wed, Feb 10, 2016 at 1:27 AM, Test Sender <test@nylas.com> wrote:
+
+
Hi Recipient, +
+
+

+
+
+
CONTENT 4
+
+

+
+
+
CONTENT 5
+ +
+

+
+
+
Best,
+
Nylas
+
+

+
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+
num
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+On Feb 9 2016, at 12:49 am, Recipient Name <email.name@nylas.com> wrote: +
+
Hi Nylas, +
+

+
+
+
Content 1
+
+Content 2
+
+Regards,
+Recipient
+
+
+

+
+
On Tue, Feb 9, 2016 at 1:37 AM, Test Sender <test@nylas.com> wrote:
+
+
Thanks APerson! +
+
+

+
+
+
Content 3 +
+ +
+

+
+
+
Best,
+
Nylas
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+
num
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+On Feb 8 2016, at 3:33 pm, Another Person <another.email@nylas.com> wrote: +
+
CONTENT 8 +
+

+
+
+
Regards,
+
APerson
+
+

+
+
+
+
+
+
+
+
+
+
+
Another Person
+
Co-founder & President of Pipedrive
+ + + +
+
+
+
+
+
+
+
+
+
+
On Mon, Feb 8, 2016 at 2:27 PM, Test Sender <test@nylas.com> wrote:
+
+
Hi APerson, +
+
+

+
+
+
CONTENT 9
+
+

+
+
+
CONTENT 10
+
+

+
+
+
Best,
+
+

+
+
+
Nylas
+ +
+

+
+
+
+
-- 
+
+
+
+
+
+
+
+
+
+
+
+
+
Test Sender
+
+
Head of Business Development and Growth
+
Nylas Inc.
+
num
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+On Feb 8 2016, at 1:40 pm, Another Person <another.email@nylas.com> wrote: +
+
Hey Nylas, +
+

+
+
+
CONTENT 11
+
+

+
+
+
CONTENT 12
+
+
+
CONTENT 13
+
+

+
+CONTENT 14
+
+
+

+
+
+
CONTENT 15
+
+

+
+
+
Regards,
+
APerson 
+
+
+

+
+
+
+
+
+
+
+
+
+
+
Another Person
+
Co-founder & President of Place
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+--
+
+
+
+
Test Person
+
Product Manager | Pipedrive
+
@testtwitter
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+--
+
+
+
+
Test Person
+
Product Manager | Pipedrive
+
@testtwitter
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+--
+
+
+
+
Test Person
+
Product Manager | Pipedrive
+
@testtwitter
+
+
+
+
+ + + \ No newline at end of file diff --git a/spec/quoted-html-transformer-spec.coffee b/spec/quoted-html-transformer-spec.coffee index d0df73eef..77aaba285 100644 --- a/spec/quoted-html-transformer-spec.coffee +++ b/spec/quoted-html-transformer-spec.coffee @@ -19,7 +19,7 @@ describe "QuotedHTMLTransformer", -> re = new RegExp(QuotedHTMLTransformer.annotationClass, 'g') html.match(re)?.length ? 0 - [1..17].forEach (n) -> + [1..18].forEach (n) -> it "properly parses email_#{n}", -> opts = keepIfWholeBodyIsQuote: true expect(removeQuotedHTML("email_#{n}.html", opts)).toEqual readFile("email_#{n}_stripped.html") @@ -347,7 +347,7 @@ describe "QuotedHTMLTransformer", -> # `QuotedHTMLTransformer` needs Electron booted up in order to work because # of the DOMParser. xit "Run this simple funciton to generate output files", -> - [17].forEach (n) -> + [18].forEach (n) -> newHTML = QuotedHTMLTransformer.removeQuotedHTML(readFile("email_#{n}.html")) outPath = path.resolve(__dirname, 'fixtures', 'emails', "email_#{n}_raw_stripped.html") fs.writeFileSync(outPath, newHTML)