mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 15:17:03 +02:00
Added DelSp support
This commit is contained in:
@@ -1891,7 +1891,7 @@ public class HtmlHelper {
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3676
|
||||
static String flow(String text) {
|
||||
static String flow(String text, boolean delsp) {
|
||||
boolean continuation = false;
|
||||
StringBuilder flowed = new StringBuilder();
|
||||
String[] lines = text.split("\\r?\\n");
|
||||
@@ -1899,6 +1899,9 @@ public class HtmlHelper {
|
||||
String line = lines[l];
|
||||
lines[l] = null;
|
||||
|
||||
if (delsp && line.length() > 0)
|
||||
line = line.substring(0, line.length() - 1);
|
||||
|
||||
if (continuation)
|
||||
while (line.startsWith(">")) {
|
||||
line = line.substring(1);
|
||||
|
||||
@@ -2917,8 +2917,10 @@ public class MessageHelper {
|
||||
} else if (StandardCharsets.UTF_8.equals(cs))
|
||||
result = CharsetHelper.utf8toW1252(result);
|
||||
|
||||
// https://datatracker.ietf.org/doc/html/rfc3676
|
||||
if ("flowed".equalsIgnoreCase(h.contentType.getParameter("format")))
|
||||
result = HtmlHelper.flow(result);
|
||||
result = HtmlHelper.flow(result,
|
||||
"yes".equalsIgnoreCase(h.contentType.getParameter("delsp")));
|
||||
|
||||
// https://www.w3.org/QA/2002/04/valid-dtd-list.html
|
||||
if (result.length() > DOCTYPE.length()) {
|
||||
|
||||
Reference in New Issue
Block a user