Skip to content

Commit

Permalink
Fix tests for from header parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Jul 4, 2017
1 parent c072f2f commit 432ca75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const QUOTE_HEADERS_REGEX = [
/^(20[0-9]{2}\..+\s작성:)$/m, // DATE TIME NAME 작성:
/^(20[0-9]{2}\/.+のメッセージ:)$/m, // DATE TIME、NAME のメッセージ:
/^(.+\s<.+>\sschrieb:)$/m, // NAME <EMAIL> schrieb:
/^\s*(From\s?:[\S\s]+\s?(\[|<).+(\]|>))/mu, // "From: NAME <EMAIL>" OR "From : NAME <EMAIL>" OR "From : NAME<EMAIL>"(With support whitespace before start and before <)
/^\s*(De\s?:[\S\s]+\s?(\[|<).+(\]|>))/mu, // "De: NAME <EMAIL>" OR "De : NAME <EMAIL>" OR "De : NAME<EMAIL>" (With support whitespace before start and before <)
/^\s*(Van\s?:[\S\s]+\s?(\[|<).+(\]|>))/mu, // "Van: NAME <EMAIL>" OR "Van : NAME <EMAIL>" OR "Van : NAME<EMAIL>" (With support whitespace before start and before <)
/^\s*(Da\s?:[\S\s]+\s?(\[|<).+(\]|>))/mu, // "Da: NAME <EMAIL>" OR "Da : NAME <EMAIL>" OR "Da : NAME<EMAIL>" (With support whitespace before start and before <)
/^\s*(From\s?:.+\s?(\[|<).+(\]|>))/mu, // "From: NAME <EMAIL>" OR "From : NAME <EMAIL>" OR "From : NAME<EMAIL>"(With support whitespace before start and before <)
/^\s*(De\s?:.+\s?(\[|<).+(\]|>))/mu, // "De: NAME <EMAIL>" OR "De : NAME <EMAIL>" OR "De : NAME<EMAIL>" (With support whitespace before start and before <)
/^\s*(Van\s?:.+\s?(\[|<).+(\]|>))/mu, // "Van: NAME <EMAIL>" OR "Van : NAME <EMAIL>" OR "Van : NAME<EMAIL>" (With support whitespace before start and before <)
/^\s*(Da\s?:.+\s?(\[|<).+(\]|>))/mu, // "Da: NAME <EMAIL>" OR "Da : NAME <EMAIL>" OR "Da : NAME<EMAIL>" (With support whitespace before start and before <)
/^(20[0-9]{2}-(?:0?[1-9]|1[012])-(?:0?[0-9]|[1-2][0-9]|3[01]|[1-9])\s[0-2]?[0-9]:\d{2}\s[\S\s]+?:)$/m, // 20YY-MM-DD HH:II GMT+01:00 NAME <EMAIL>:
/^\s*([a-z]{3,4}\.[\s\S]+\sskrev[\s\S]+:)$/m, // DATE skrev NAME <EMAIL>:
];
Expand Down
2 changes: 1 addition & 1 deletion test/ParserTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ describe('the Parser', function () {
var email = parser.parse(fixture);
var fragments = email.getFragments();

assert.equal(fragments[1].getContent(), from + "\r \r My email is <[email protected]>", "From header not correctly matched");
assert.equal(fragments[1].getContent(), from + "\n\nMy email is <[email protected]>", "From header not correctly matched");
});
}

Expand Down

0 comments on commit 432ca75

Please sign in to comment.