Fixed displaying Usenet signature with format flowed

This commit is contained in:
M66B 2020-03-28 19:51:12 +01:00
parent ba78e99202
commit 58a98dd083
1 changed files with 9 additions and 2 deletions

View File

@ -1459,8 +1459,15 @@ public class MessageHelper {
if (part.isMimeType("text/plain")) {
// https://tools.ietf.org/html/rfc3676
if ("flowed".equalsIgnoreCase(ct.getParameter("format")))
result = result.replaceAll(" \\r?\\n", " ");
if ("flowed".equalsIgnoreCase(ct.getParameter("format"))) {
StringBuilder flowed = new StringBuilder();
for (String line : result.split("\\r?\\n")) {
flowed.append(line);
if (!line.endsWith(" ") || "-- ".equals(line))
flowed.append("\r\n");
}
result = flowed.toString();
}
result = "<div>" + HtmlHelper.formatPre(result) + "</div>";
} else if (part.isMimeType("text/html")) {
if (TextUtils.isEmpty(charset)) {