forked from zapier/email-reply-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
New Yahoo rules #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a024b96
fix: discard trailing whitespace when analysing reply
alexei 2ca7284
test: unquoted quote
alexei d1fe5cb
fix: newline handling
alexei 8237df9
fix: use previously declared variable to reduce method calls
alexei af3304d
chore: bump version
alexei d3bab79
test: check replies as well
alexei 44b5538
test: include test case for multiline header seen in GMail
alexei c97e45e
fix: strip trailing spaces for quote headers only
alexei 6d6a0d7
chore: bump version
alexei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Base tax cost environment side. May house most director treatment call heavy. | ||
| Forward professional woman institution happen. Tell girl hope to. Wrong perhaps apply anything expert main indeed. | ||
|
|
||
| On Monday, April 13, 2020, 06:49:16 PM GMT+3, Paige Lee wrote: | ||
|
|
||
| Thank experience bag memory hundred understand of. Environmental lose probably majority peace behind. When produce ask tough. | ||
| Institution thought system class nice instead speak. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Resource popular local capital doctor. Wish with think north shoulder stand catch. Decade many production food view only green. | ||
|
|
||
| Believe concern floor treatment admit keep maintain put. | ||
| On Friday, April 3, 2020, 06:05:24 PM EDT, Vicki Davis wrote: | ||
|
|
||
|
|
||
| Example myself effect understand miss idea. Tonight work home policy arm time report. | ||
|
|
||
| Against rest concern each hotel. Person care policy sea. Attack realize suggest save all everything scientist. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about changing
HEADER_REGEXfromr'^\*?(From|Sent|To|Subject):\*? .+'tor'^\s*\*?(From|Sent|To|Subject):\*? .+'instead?Other expressions seem not to care about leading whitespaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that Yahoo! started behaving weirdly - they add extra spaces everywhere, then they add what appear to be random
|s where the original message should be (are they trying to recreate the table cells using|s?). See for example:I figured it was safer, for parsing purposes, if we ignored trailing spaces on every line.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may result in working incorrectly when someone adds leading spaces intentionally.
For example, list items or code with indents.
I agree that there is a little chance that the spaces will be important in our use case, but for a general-purpose library it's not good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree an email may contain whitespace that's no accident. However, you're gonna have a hard time distinguishing between user intent and email servers' vagaries.
I updated the code to reflect the change that's been observed in Yahoo! behavior. Indeed, it's fair that I don't make assumptions about the other lines.