Fixed preformatted text

This commit is contained in:
M66B 2020-05-02 10:05:22 +02:00
parent 63ee1b1c99
commit 198612dac6
3 changed files with 7 additions and 6 deletions

View File

@ -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 = "<pre>" + HtmlHelper.formatPre(text) + "</pre>";
Helper.writeText(message.getFile(context), html);
db.message().setMessageStored(message.id, new Date().getTime());
db.message().setMessageFts(message.id, false);

View File

@ -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

View File

@ -1589,7 +1589,7 @@ public class MessageHelper {
if (part.isMimeType("text/plain")) {
if ("flowed".equalsIgnoreCase(ct.getParameter("format")))
result = HtmlHelper.flow(result);
result = "<div>" + HtmlHelper.formatPre(result) + "</div>";
result = "<pre>" + HtmlHelper.formatPre(result) + "</pre>";
} else if (part.isMimeType("text/html")) {
if (TextUtils.isEmpty(charset)) {
// <meta charset="utf-8" />