From 13898f7edf9ba49cc68f2c80c3d61524ea37f1d6 Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Fri, 28 Jan 2011 21:41:06 +0000 Subject: [PATCH] Fix the way newlines are added in HTML mode. --- src/com/fsck/k9/activity/MessageCompose.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index ab0fdd1f4..db291e59b 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -967,8 +967,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc mQuotedHtmlContent.clearQuotedContent(); } - mQuotedHtmlContent.setUserContent(text); - // Set the insertion location based upon our reply after quote setting. Reply after // quote makes no sense for HEADER style replies. In addition, add some extra // separators between the composed message and quoted message depending on the quote @@ -980,7 +978,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc mQuotedHtmlContent.setInsertionLocation(InsertableHtmlContent.InsertionLocation.AFTER_QUOTE); if (!isDraft) { - text = "

" + text; + text = "
" + text; } } else @@ -988,9 +986,12 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc mQuotedHtmlContent.setInsertionLocation(InsertableHtmlContent.InsertionLocation.BEFORE_QUOTE); if (!isDraft) { - text += "
"; + text += "

"; } } + + mQuotedHtmlContent.setUserContent(text); + // All done. Build the body. TextBody body = new TextBody(mQuotedHtmlContent.toString()); // Save length of the body and its offset. This is used when thawing drafts. @@ -2955,7 +2956,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc if (quoteStyle == QuoteStyle.PREFIX) { StringBuilder header = new StringBuilder(QUOTE_BUFFER_LENGTH); - header.append("
"); + header.append("
"); // Remove all trailing newlines so that the quote starts immediately after the header. "Be like Gmail!" header.append(HtmlConverter.textToHtmlFragment(String.format( getString(R.string.message_compose_reply_header_fmt).replaceAll("\n$", ""),