Fixed displaying Usenet signature with format flowed

pull/178/head
M66B 5 years ago
parent ba78e99202
commit 58a98dd083

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

Loading…
Cancel
Save