-
Notifications
You must be signed in to change notification settings - Fork 117
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
Don't split Quoted Printable characters during folding procedure #22
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
==========================================
+ Coverage 88.2% 88.39% +0.18%
==========================================
Files 13 13
Lines 373 379 +6
==========================================
+ Hits 329 335 +6
Misses 25 25
Partials 19 19
Continue to review full report at Codecov.
|
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.
Otherwise LGTM. Adding a comment to explain a little the new code would be great, this function is a little tricky.
header.go
Outdated
@@ -40,6 +41,8 @@ func formatHeaderField(k, v string) string { | |||
return s + "\r\n" | |||
} | |||
|
|||
qpReg := regexp.MustCompile("(=[0-9A-Z]{2,2})+") |
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.
Can you move this outside the function, as a global variable?
Added comments, converted regexp in to a global var. |
Thanks! |
Cool, thanks. Only problem I just noticed with this change is that it insertes extra whitespace before QP character. Can this whitespace be ommited? I can submit another PR in case if I can just drop whitespace if folding step is gonna happen on QP regexp and not a whitespace. |
I don't think so, but let me know if you find a way to do that. The whitespace at the beginning of the line is used to mark folding. |
What about then folding only on whitespaces or doing hard split in case
its a one long word? This patch solves the issue, but still sometimes
inserts whitespace before single or double quote for example.
…On 21/03/18 13:35, emersion wrote:
Can this whitespace be ommited?
I don't think so, but let me know if you find a way to do that. The
whitespace at the beginning of the line is used to mark folding.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQQI65cuddJpEp_ZtfuuveY8QxQtU49ks5tgo9CgaJpZM4Su166>.
|
Yeah, that would be better. |
I noticed that subjects sometimes are misformatted in my mail client due to improperly splitted quoted printable characters. Here is a small fix that should address this issue.
Thanks!