diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 1c3f63f829..388a170e3c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -5268,7 +5268,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. // Write decrypted body String text = Helper.readText(plain); - String html = HtmlHelper.formatPre(text); + String html = "
" + HtmlHelper.formatPre(text) + "
"; Helper.writeText(message.getFile(context), html); db.message().setMessageStored(message.id, new Date().getTime()); db.message().setMessageFts(message.id, false); diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index d39d5490e5..daf44eccca 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -697,10 +697,11 @@ public class HtmlHelper { // Pre formatted text // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre - for (Element pre : document.select("pre")) { - pre.html(formatPre(pre.wholeText())); - pre.tagName("div"); - } + if (!view) + for (Element pre : document.select("pre")) { + pre.html(formatPre(pre.wholeText())); + pre.tagName("div"); + } // Code // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index aa10451740..4e9724872e 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -1589,7 +1589,7 @@ public class MessageHelper { if (part.isMimeType("text/plain")) { if ("flowed".equalsIgnoreCase(ct.getParameter("format"))) result = HtmlHelper.flow(result); - result = "
" + HtmlHelper.formatPre(result) + "
"; + result = "
" + HtmlHelper.formatPre(result) + "
"; } else if (part.isMimeType("text/html")) { if (TextUtils.isEmpty(charset)) { //