GNOME Bugzilla – Bug 731746
Empty lines removed in plaintext messages
Last modified: 2014-06-19 20:38:22 UTC
Created attachment 278558 [details] Message as received I'm using Geary from the bleeding edge PPA (ppa:yorba/daily-builds). According to dpkg my version is 201406110122~0.6.0+1427~ubuntu14.04.1. When composing a plaintext message, everything looks fine in the composer window, but once sent the message seems to be missing empty lines between paragraphs. That is to say, I need to insert two lines between each paragraph in order for there to be one line as seen by the recipient, or as seen in the Sent Mail folder. See the attached screenshots which demonstrate the issue.
Created attachment 278559 [details] Message as sent
How reproducible is this? Is there a particular message that reliably triggers it? (I tried sending a similar message to myself and didn't see a problem.) We've had similar issues in the past (see bug #713990, bug #723815). I had hoped that we'd killed all of them, but I'm not surprised to see it again. The basic problem is that the composer is actually creating HTML and then turning that into plain text. And for some reason, blank lines appear or disappear in this process.
It happens 100% for me with plaintext messages in the current build I'm running. That makes sense re: the HTML->plain text conversion; kinda figured something like that was happening. Note that in the Gmail Web UI as well the line breaks are missing, but I just noticed that in Evolution the message line breaks show up. Perhaps it's related to the format=flowed we set for the Content-Type: header? I noticed that other plain-text messages I send don't have that...
I dug into this a little more and it looks like the line break is only removed if there's a trailing space on the previous line. Not sure if that makes it any easier to "fix" but at least I understand the behavior now and can train myself to not leave any trailing space.
(In reply to comment #4) > I dug into this a little more and it looks like the line break is only removed > if there's a trailing space on the previous line. Aha! A trailing space is a signal in the flowed-text plain text format that the paragraph continues on the next line. I don't see any thing in RFC 3676 about encoding a line-ending space, so I think we should just delete this before sending the message through our flowed-text formatter.
Created attachment 278801 [details] [review] Remove trailing whitespace before wrapping plain text This is overkill in some sense, since it'll remove whitespace other than spaces as well. But that's a reasonable thing to do, I think, and it may help avoid other confusing situations.
Review of attachment 278801 [details] [review]: Commit!
Attachment 278801 [details] pushed as 3895730 - Remove trailing whitespace before wrapping plain text
Thanks for the quick turnaround! I applied the patch and verified it worked for me as well.