mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-26 19:05:23 +01:00
Break flow on start/end quote
This commit is contained in:
@@ -2016,6 +2016,7 @@ public class HtmlHelper {
|
||||
// https://tools.ietf.org/html/rfc3676
|
||||
static String flow(String text, boolean delsp) {
|
||||
boolean continuation = false;
|
||||
boolean inquote = false;
|
||||
StringBuilder flowed = new StringBuilder();
|
||||
String[] lines = text.split("\\r?\\n");
|
||||
for (int l = 0; l < lines.length; l++) {
|
||||
@@ -2025,6 +2026,15 @@ public class HtmlHelper {
|
||||
if (delsp && line.endsWith(" "))
|
||||
line = line.substring(0, line.length() - 1);
|
||||
|
||||
boolean q = line.startsWith(">");
|
||||
if (q != inquote) {
|
||||
int len = flowed.length();
|
||||
if (len > 0 && flowed.charAt(len - 1) != '\n')
|
||||
flowed.append("\n");
|
||||
continuation = false;
|
||||
}
|
||||
inquote = q;
|
||||
|
||||
if (continuation)
|
||||
while (line.startsWith(">")) {
|
||||
line = line.substring(1);
|
||||
|
||||
Reference in New Issue
Block a user