From 44dd8dda55bb369ee03b73b48c9a08c373a73d4e Mon Sep 17 00:00:00 2001 From: ReptoxX <13363890+ReptoxX@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:44:32 +0200 Subject: [PATCH 1/3] Added german Version of From: NAME --- lib/regex.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/regex.js b/lib/regex.js index 1a7f6c9..7875fd6 100644 --- a/lib/regex.js +++ b/lib/regex.js @@ -20,6 +20,7 @@ class RegexList { /^(.+\s<.+>\sschrieb:)$/m, // NAME schrieb: /^(.+\son.*at.*wrote:)$/m, // NAME on DATE wrote: /^\s*(From\s?:.+\s?\n?\s*[\[|<].+[\]|>])/m, // "From: NAME " OR "From : NAME " OR "From : NAME"(With support whitespace before start and before <) + /^\s*(Von\s?:.+\s?\n?\s*[\[|<].+[\]|>])/m, // "Von: NAME " OR "Von : NAME " OR "Von : NAME"(With support whitespace before start and before <) /^\s*(De\s?:.+\s?\n?\s*(\[|<).+(\]|>))/m, // "De: NAME " OR "De : NAME " OR "De : NAME" (With support whitespace before start and before <) /^\s*(Van\s?:.+\s?\n?\s*(\[|<).+(\]|>))/m, // "Van: NAME " OR "Van : NAME " OR "Van : NAME" (With support whitespace before start and before <) /^\s*(Da\s?:.+\s?\n?\s*(\[|<).+(\]|>))/m, // "Da: NAME " OR "Da : NAME " OR "Da : NAME" (With support whitespace before start and before <) @@ -62,4 +63,4 @@ class RegexList { } } -module.exports = new RegexList(); \ No newline at end of file +module.exports = new RegexList(); From 613bbe91667f78af5e92693ec169a5283dd09db4 Mon Sep 17 00:00:00 2001 From: ReptoxX <13363890+ReptoxX@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:59:09 +0200 Subject: [PATCH 2/3] Create email_german_2.txt --- test/fixtures/email_german_2.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/fixtures/email_german_2.txt diff --git a/test/fixtures/email_german_2.txt b/test/fixtures/email_german_2.txt new file mode 100644 index 0000000..3dfc0c3 --- /dev/null +++ b/test/fixtures/email_german_2.txt @@ -0,0 +1,12 @@ +Fusce bibendum, quam hendrerit sagittis tempor, dui turpis tempus erat, pharetra sodales ante sem sit amet metus. +Nulla malesuada, orci non vulputate lobortis, massa felis pharetra ex, convallis consectetur ex libero eget ante. +Nam vel turpis posuere, rhoncus ligula in, venenatis orci. Duis interdum venenatis ex a rutrum. +Duis ut libero eu lectus consequat consequat ut vel lorem. Vestibulum convallis lectus urna, +et mollis ligula rutrum quis. Fusce sed odio id arcu varius aliquet nec nec nibh. + +Von: John Doe +Gesendet: Donnerstag, 23. März 2023 17:11 +An: John Doe +Betreff: AW: Hi there! + +Hi there! From 113fa26e1cbdd8e7fb34baaaced3bcff9eebf734 Mon Sep 17 00:00:00 2001 From: ReptoxX <13363890+ReptoxX@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:00:14 +0200 Subject: [PATCH 3/3] Update test.js --- test/test.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index bae9142..6cb48b4 100644 --- a/test/test.js +++ b/test/test.js @@ -267,6 +267,16 @@ exports.test_email_german = function(test) { test.done(); }; +exports.test_email_german_2 = function(test) { + let email = get_email("email_german_2"); + + let fragments = email.getFragments(); + + test.equal(COMMON_FIRST_FRAGMENT, fragments[0].toString().trim()); + + test.done(); +}; + exports.test_email_gmail_no = function(test) { let email = get_email("email_norwegian_gmail"); @@ -470,4 +480,4 @@ exports.test_email_en_multiline_2 = function(test) { test.equal(2, fragments.length); test.done(); -} \ No newline at end of file +}