-
Notifications
You must be signed in to change notification settings - Fork 107
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
WIP: Line wrapping for text/plain content #135
Conversation
At present this just uses the same wrapping implementation as the base64 content. @jhillyerd from my reading this won't matter, but let em know if you would prefer to see this not wrap mid-word. Still work to do writing more tests for increased coverage instead of decreasing... Please do not merge yet (I forgot to create this as a draft PR) |
Thinking about this a bit... the only reason to force a wrap before 76-80 characters is to improve the readability of the text in a plain text email program, or when viewing the source - if we split the line in the middle of the word, we aren't improving the readability. It may be better to pick an wider (but <= 998) number so that if the email is wrapped at something slightly higher than 76, we allow it to pass through, otherwise we hard wrap to remain compliant with the spec. There is some interesting reading in rfc3676 4.2, but I don't know much about format=flowed. |
I will follow the technique described in paragraph six of rfc3676 4.2, the "newer" one. I feel there is enough feature description in the following sections to implement format-(fixed/flowed), delsp-(yes/no), space-stuffing, quoting and even take the Usenet signature separator into consideration. |
Looks like there is a reasonable implementation, for decoding, flowed text in k9mail. Porting that shouldn't take too long, but creating an encoder for it will take longer. |
Looks like html is out of scope for this:
|
@jhillyerd I ported the feature verbatim and wrote one test around the only example in the rfc. I need to find a preferred implementation, like either pine or mutt, where I can generate some testdata samples programmatically. |
Implementing text wrapping for
text/html
is a bit more involved, such that we don't break mid-tag. We should create an issue to track wrapping html content for the future.closes #63