GNOME Bugzilla – Bug 353524
tabs are lost when saving draft in text format
Last modified: 2013-09-13 00:48:33 UTC
Please describe the problem: When saving the mail created in TEXT format, the TAB character is not exapnded in the HTML part of the mail Steps to reproduce: 1. File - New - Mail Message 2. Insert the following example : asdfasf <tab key>tab 3. Then File - Save Draft 4. Check mail content in the Draft folder Actual results: tab is not expanded to spaces Expected results: the tab is expanded to spaces both in plain text and html mail part Does this happen every time? yes Other information: Let have a look to this mail : --=-yPVV/KEBhA1hCIitYXEZ Content-Type: text/plain Content-Transfer-Encoding: 7bit asdfasf tab --=-yPVV/KEBhA1hCIitYXEZ Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"> <META NAME="GENERATOR" CONTENT="GtkHTML/3.10.2"> </HEAD> <BODY> asdfasf<BR> <!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--> tab </BODY> </HTML> --=-yPVV/KEBhA1hCIitYXEZ--
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. Just as bug 242408, I believe this is another duplicate of bug 237830. *** This bug has been marked as a duplicate of 237830 ***
I think this bug is not the same as bug 237830. Because all tabs are lost not only the first one. When one save the draft as HTML format, the tabs will be expanded to spaces, so when the draft is opened again, the tabs will not be lost. But when one save the draft as TEXT format, the tabs will be left untouched as \t in both TEXT section and HTML section. But \t is not recognized by html engine, so when the draft is open again, the tabs will be lost.
Yes, just as bug 242408, which is talking about tabs being converted into single spaces. It does not specifically talk about the tab being the first char. Still, I believe this to be a duplicate of bug 237830. Despite the initial report, it turned out that whitespace handling is poor in general, when it comes to saving text/plain mails as Draft. Marking as duplicate again. I'm going to add a few more words to that bug. Wang, thanks for caring about the bug report! :) If you still don't think that these bugs are the same issue, please feel free to re-open this bug. *** This bug has been marked as a duplicate of 237830 ***
I think the cause is that tabs are ignored by html engine if the mail is TEXT format(the draft will be saved as multipart/alternative). So we have 3 solutions: 1.Do not save the mail in TEXT format as multipart/alternative, just save it as plain text mail. In this case we have to make a little modification of evolution. 2.When we read the draft, read the correct part from multipart mail. For TEXT mail we read TEXT part, for HTML mail we read HTML part. In this case we have to make modification of evolution too and it's a little more complicated. 3.Make html engine expand tabs to nbsp. In this case we have to make modification of gtkhtml, and it's complicated too.
Created attachment 72190 [details] [review] patch to make the composer do not save html section for TEXT format draft
Created attachment 72191 [details] [review] the patch to make evolution read the right section from drafts patch for the 2nd solution