email-reply-parser
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -10,3 +10,3 @@ var FragmentDTO = require("./fragmentdto"); | ||
this.quoteHeadersRegex = [ | ||
/^\s*(On(?:(?!^>*\s*On\b|\bwrote(:)?)[\s\S]){0,1000}wrote:?)$/m, // On DATE, NAME <EMAIL> wrote: | ||
/^\-*\s*(On(?:(?!^>*\s*On\b|\bwrote(:)?)[\s\S]){0,1000}wrote:?)\s*\-*$/m, // On DATE, NAME <EMAIL> wrote: | ||
/^\s*(Le(?:(?!^>*\s*Le\b|\bécrit:)[\s\S]){0,1000}écrit :)$/m, // Le DATE, NAME <EMAIL> a écrit : | ||
@@ -13,0 +13,0 @@ /^\s*(El(?:(?!^>*\s*El\b|\bescribió:)[\s\S]){0,1000}escribió:)$/m, // El DATE, NAME <EMAIL> escribió: |
{ | ||
"name": "email-reply-parser", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Node library for parsing plain text email content. Based on https://github.com/willdurand/EmailReplyParser", | ||
@@ -9,3 +9,3 @@ "main": "lib/emailreplyparser.js", | ||
}, | ||
"author": "Crisp IM Inc", | ||
"author": "Crisp IM SARL", | ||
"license": "MIT", | ||
@@ -12,0 +12,0 @@ "devDependencies": { |
@@ -7,3 +7,3 @@ # Email Reply Parser | ||
This library suppots most email replies, signatures and locales. | ||
This library supports most email replies, signatures and locales. | ||
@@ -10,0 +10,0 @@ ## Who uses it? |
@@ -24,12 +24,10 @@ var fs = require("fs"); | ||
test.equal(3, reply.fragments.length); | ||
test.equal(2, reply.fragments.length); | ||
test.deepEqual([false, false, false], _.map(reply.fragments, function(f) { return f.isQuoted; })); | ||
test.deepEqual([false, true, true], _.map(reply.fragments, function(f) { return f.isSignature; })); | ||
test.deepEqual([false, true, true], _.map(reply.fragments, function(f) { return f.isHidden; })); | ||
test.deepEqual([false, false], _.map(reply.fragments, function(f) { return f.isQuoted; })); | ||
test.deepEqual([false, true], _.map(reply.fragments, function(f) { return f.isHidden; })); | ||
test.equal("Hi folks\n\nWhat is the best way to clear a Riak bucket of all key, values after\nrunning a test?\nI am currently using the Java HTTP API.\n", reply.fragments[0].toString()); | ||
test.equal("Hi folks\n\nWhat is the best way to clear a Riak bucket of all key, values after\nrunning a test?\nI am currently using the Java HTTP API.\n\n-Abhishek Kona\n\n", reply.fragments[0].toString()); | ||
test.equal("-Abhishek Kona\n\n", reply.fragments[1].toString()); | ||
test.done(); | ||
test.done(); | ||
}; | ||
@@ -41,22 +39,4 @@ | ||
let fragments = email.getFragments(); | ||
test.equal(5, fragments.length); | ||
test.equal(false, fragments[0].isQuoted); | ||
test.equal(false, fragments[1].isQuoted); | ||
test.equal(true, fragments[2].isQuoted); | ||
test.equal(false, fragments[3].isQuoted); | ||
test.equal(false, fragments[4].isQuoted); | ||
test.equal(false, fragments[0].isSignature); | ||
test.equal(true, fragments[1].isSignature); | ||
test.equal(false, fragments[2].isSignature); | ||
test.equal(false, fragments[3].isSignature); | ||
test.equal(true, fragments[4].isSignature); | ||
test.equal(false, fragments[0].isHidden); | ||
test.equal(true, fragments[1].isHidden); | ||
test.equal(true, fragments[2].isHidden); | ||
test.equal(true, fragments[3].isHidden); | ||
test.equal(true, fragments[4].isHidden); | ||
test.equal(true, /^Oh thanks.\n\nHaving/.test(fragments[0])); | ||
test.equal(true, /^-A/.test(fragments[1])); | ||
test.equal(true, /^On [^\:]+\:/.test(fragments[2])); | ||
test.equal(true, /^_/.test(fragments[4])); | ||
test.equal("Hi folks\n\nWhat is the best way to clear a Riak bucket of all key, values after\nrunning a test?\nI am currently using the Java HTTP API.\n\n-Abhishek Kona\n\n", reply.fragments[0].toString()); | ||
@@ -355,3 +335,3 @@ test.done(); | ||
test.equal(email.getVisibleText(), "🎉\n"); | ||
test.equal(email.getVisibleText(), "🎉\n\n—\nJohn Doe\nCEO at Pandaland\n\n@pandaland"); | ||
@@ -433,2 +413,12 @@ test.done(); | ||
test.done(); | ||
} | ||
exports.text_email_zoho = function(test) { | ||
let email = get_email("email_zoho"); | ||
let fragments = email.getFragments(); | ||
test.equal("What is the best way to clear a Riak bucket of all key, values after\nrunning a test?\n", fragments[0].toString()); | ||
test.done(); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62
85290
510