email-reply-parser
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -5,4 +5,2 @@ var FragmentDTO = require("./fragmentdto"); | ||
const SIG_REGEX = /(?:^\s*--|^\s*__|^—$|^—\w|^-\w|^-- $)|(?:^Sent from (?:\s*.+)$)|(?:^={30,}$)$/; | ||
const QUOTE_REGEX = /(>+)$/; | ||
@@ -33,2 +31,14 @@ | ||
this.signatureRegex = [ | ||
/^\s*--/, | ||
/^\s*__/, | ||
/^—/, | ||
/^—\w/, | ||
/^-\w/, | ||
/^-- $/, | ||
/^Sent from (?:\s*.+)$/, | ||
/^Envoyé depuis (?:\s*.+)$/, | ||
/^={30,}$/ | ||
]; | ||
this.fragments = []; | ||
@@ -155,3 +165,7 @@ } | ||
isSignature(line) { | ||
return SIG_REGEX.test(this.stringReverse(line)); | ||
let text = this.stringReverse(line); | ||
return this.signatureRegex.some((regex) => { | ||
return regex.test(text); | ||
}); | ||
} | ||
@@ -158,0 +172,0 @@ |
{ | ||
"name": "email-reply-parser", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Node library for parsing plain text email content. Based on https://github.com/willdurand/EmailReplyParser", | ||
@@ -5,0 +5,0 @@ "main": "lib/emailreplyparser.js", |
71379
416