mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-03 07:36:31 +02:00
Refactoring
This commit is contained in:
@@ -936,6 +936,27 @@ public class HtmlHelper {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3676
|
||||
static String flow(String text) {
|
||||
boolean continuation = false;
|
||||
StringBuilder flowed = new StringBuilder();
|
||||
for (String line : text.split("\\r?\\n")) {
|
||||
if (continuation)
|
||||
while (line.startsWith(">")) {
|
||||
line = line.substring(1);
|
||||
if (line.startsWith(" "))
|
||||
line = line.substring(1);
|
||||
}
|
||||
|
||||
continuation = (line.endsWith(" ") && !"-- ".equals(line));
|
||||
|
||||
flowed.append(line);
|
||||
if (!continuation)
|
||||
flowed.append("\r\n");
|
||||
}
|
||||
return flowed.toString();
|
||||
}
|
||||
|
||||
static String formatPre(String text) {
|
||||
int level = 0;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user