email-forward-parser 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/parser.js +39 -34
- package/package.json +1 -1
package/lib/parser.js
CHANGED
|
@@ -11,12 +11,13 @@ var MAILBOXES_SEPARATORS = [
|
|
|
11
11
|
];
|
|
12
12
|
|
|
13
13
|
var REGEXES = {
|
|
14
|
-
quote_line_break : /^(>+)\s?$/gm, // Apple Mail
|
|
14
|
+
quote_line_break : /^(>+)\s?$/gm, // Apple Mail, Missive
|
|
15
15
|
quote : /^(>+)\s?/gm, // Apple Mail
|
|
16
16
|
four_spaces : /^(\ {4})\s?/gm, // Outlook 2019
|
|
17
17
|
carriage_return : /\r\n/gm, // Outlook 2019
|
|
18
|
-
byte_order_mark :
|
|
19
|
-
|
|
18
|
+
byte_order_mark : /\uFEFF/gm, // Outlook 2019
|
|
19
|
+
trailing_non_breaking_space : /\u00A0$/gm, // IONOS by 1 & 1
|
|
20
|
+
non_breaking_space : /\u00A0/gm, // HubSpot
|
|
20
21
|
|
|
21
22
|
subject : [
|
|
22
23
|
/^Fw:(.*)/m, // Outlook Live / 365 (cs, en, hr, hu, sk), Yahoo Mail (all locales)
|
|
@@ -79,37 +80,38 @@ var REGEXES = {
|
|
|
79
80
|
/^\s?.+\s?používateľ\s?.+\s*\([\[|<].+[\]|>]\)\s?napísal\s?:/m, // Outlook 2019 (sk)
|
|
80
81
|
/^\s?Den\s?.+\s?skrev\s?\".+\"\s*[\[|<].+[\]|>]\s?följande\s?:/m, // Outlook 2019 (sv)
|
|
81
82
|
/^\s?\".+\"\s*[\[|<].+[\]|>]\,\s?.+\s?tarihinde şunu yazdı\s?:/m, // Outlook 2019 (tr)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
83
|
+
/^\s*-{5,8} Přeposlaná zpráva -{5,8}\s*/m, // Yahoo Mail (cs), Thunderbird (cs)
|
|
84
|
+
/^\s*-{5,8} Videresendt meddelelse -{5,8}\s*/m, // Yahoo Mail (da), Thunderbird (da)
|
|
85
|
+
/^\s*-{5,10} Weitergeleitete Nachricht -{5,10}\s*/m, // Yahoo Mail (de), Thunderbird (de), HubSpot (de)
|
|
86
|
+
/^\s*-{5,8} Forwarded Message -{5,8}\s*/m, // Yahoo Mail (en), Thunderbird (en)
|
|
87
|
+
/^\s*-{5,10} Mensaje reenviado -{5,10}\s*/m, // Yahoo Mail (es), Thunderbird (es), HubSpot (es)
|
|
88
|
+
/^\s*-{5,10} Edelleenlähetetty viesti -{5,10}\s*/m, // Yahoo Mail (fi), HubSpot (fi)
|
|
89
|
+
/^\s*-{5} Message transmis -{5}\s*/m, // Yahoo Mail (fr)
|
|
90
|
+
/^\s*-{5,8} Továbbított üzenet -{5,8}\s*/m, // Yahoo Mail (hu), Thunderbird (hu)
|
|
91
|
+
/^\s*-{5,10} Messaggio inoltrato -{5,10}\s*/m, // Yahoo Mail (it), HubSpot (it)
|
|
92
|
+
/^\s*-{5,10} Doorgestuurd bericht -{5,10}\s*/m, // Yahoo Mail (nl), Thunderbird (nl), HubSpot (nl)
|
|
93
|
+
/^\s*-{5,8} Videresendt melding -{5,8}\s*/m, // Yahoo Mail (no), Thunderbird (no)
|
|
94
|
+
/^\s*-{5} Przekazana wiadomość -{5}\s*/m, // Yahoo Mail (pl)
|
|
95
|
+
/^\s*-{5,8} Mensagem reencaminhada -{5,8}\s*/m, // Yahoo Mail (pt), Thunderbird (pt)
|
|
96
|
+
/^\s*-{5,10} Mensagem encaminhada -{5,10}\s*/m, // Yahoo Mail (pt-br), Thunderbird (pt-br), HubSpot (pt-br)
|
|
97
|
+
/^\s*-{5,8} Mesaj redirecționat -{5,8}\s*/m, // Yahoo Mail (ro)
|
|
98
|
+
/^\s*-{5} Пересылаемое сообщение -{5}\s*/m, // Yahoo Mail (ru)
|
|
99
|
+
/^\s*-{5} Preposlaná správa -{5}\s*/m, // Yahoo Mail (sk)
|
|
100
|
+
/^\s*-{5,10} Vidarebefordrat meddelande -{5,10}\s*/m, // Yahoo Mail (sv), Thunderbird (sv), HubSpot (sv)
|
|
101
|
+
/^\s*-{5} İletilmiş Mesaj -{5}\s*/m, // Yahoo Mail (tr)
|
|
102
|
+
/^\s*-{5} Перенаправлене повідомлення -{5}\s*/m, // Yahoo Mail (uk)
|
|
103
|
+
/^\s*-{8} Välitetty viesti \/ Fwd.Msg -{8}\s*/m, // Thunderbird (fi)
|
|
104
|
+
/^\s*-{8,10} Message transféré -{8,10}\s*/m, // Thunderbird (fr), HubSpot (fr)
|
|
105
|
+
/^\s*-{8} Proslijeđena poruka -{8}\s*/m, // Thunderbird (hr)
|
|
106
|
+
/^\s*-{8} Messaggio Inoltrato -{8}\s*/m, // Thunderbird (it)
|
|
107
|
+
/^\s*-{3} Treść przekazanej wiadomości -{3}\s*/m, // Thunderbird (pl)
|
|
108
|
+
/^\s*-{8} Перенаправленное сообщение -{8}\s*/m, // Thunderbird (ru)
|
|
109
|
+
/^\s*-{8} Preposlaná správa --- Forwarded Message -{8}\s*/m, // Thunderbird (sk)
|
|
110
|
+
/^\s*-{8} İletilen İleti -{8}\s*/m, // Thunderbird (tr)
|
|
111
|
+
/^\s*-{8} Переслане повідомлення -{8}\s*/m, // Thunderbird (uk)
|
|
112
|
+
/^\s*-{9,10} メッセージを転送 -{9,10}\s*/m, // HubSpot (ja)
|
|
113
|
+
/^\s*-{9,10} Wiadomość przesłana dalej -{9,10}\s*/m, // HubSpot (pl)
|
|
114
|
+
/^>?\s*-{10} Original Message -{10}\s*/m // IONOS by 1 & 1 (en)
|
|
113
115
|
],
|
|
114
116
|
|
|
115
117
|
separator_with_information : [
|
|
@@ -419,6 +421,9 @@ class Parser {
|
|
|
419
421
|
// Remove Byte Order Mark
|
|
420
422
|
_body = _body.replace(this.__regexes.byte_order_mark, "");
|
|
421
423
|
|
|
424
|
+
// Remove trailing Non-breaking space
|
|
425
|
+
_body = _body.replace(this.__regexes.trailing_non_breaking_space, "");
|
|
426
|
+
|
|
422
427
|
// Replace Non-breaking space with regular space
|
|
423
428
|
_body = _body.replace(this.__regexes.non_breaking_space, " ");
|
|
424
429
|
|