diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java
index 382e12bc72..ec875a2838 100644
--- a/app/src/main/java/eu/faircode/email/HtmlHelper.java
+++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java
@@ -1571,7 +1571,7 @@ public class HtmlHelper {
return formatPre(text, true);
}
- static String formatPre(String text, boolean quote) {
+ static String formatPre(String text, boolean view) {
int level = 0;
StringBuilder sb = new StringBuilder();
String[] lines = text.split("\\r?\\n");
@@ -1581,7 +1581,7 @@ public class HtmlHelper {
// Opening quotes
// https://tools.ietf.org/html/rfc3676#section-4.5
- if (quote) {
+ if (view) {
int tlevel = 0;
while (line.startsWith(">")) {
tlevel++;
@@ -1621,7 +1621,9 @@ public class HtmlHelper {
line = Html.escapeHtml(line);
sb.append(line);
- sb.append("
");
+ if (view ||
+ (l + 1 == lines.length && text.endsWith("\n")))
+ sb.append("
");
}
// Closing quotes