mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 22:56:33 +02:00
Plain text: apply quotes lastly
This commit is contained in:
@@ -2764,22 +2764,6 @@ public class HtmlHelper {
|
||||
}
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3676#section-4.5
|
||||
for (QuoteSpan span : ssb.getSpans(0, ssb.length(), QuoteSpan.class)) {
|
||||
int start = ssb.getSpanStart(span);
|
||||
int end = ssb.getSpanEnd(span);
|
||||
|
||||
for (int i = end - 2; i >= start; i--)
|
||||
if (ssb.charAt(i) == '\n')
|
||||
if (i + 1 < ssb.length() && ssb.charAt(i + 1) == '>')
|
||||
ssb.insert(i + 1, ">");
|
||||
else
|
||||
ssb.insert(i + 1, "> ");
|
||||
|
||||
if (start < ssb.length())
|
||||
ssb.insert(start, ssb.charAt(start) == '>' ? ">" : "> ");
|
||||
}
|
||||
|
||||
for (BulletSpan span : ssb.getSpans(0, ssb.length(), BulletSpan.class)) {
|
||||
int start = ssb.getSpanStart(span);
|
||||
if (span instanceof NumberSpan) {
|
||||
@@ -2809,6 +2793,22 @@ public class HtmlHelper {
|
||||
ssb.replace(start, end, LINE);
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3676#section-4.5
|
||||
for (QuoteSpan span : ssb.getSpans(0, ssb.length(), QuoteSpan.class)) {
|
||||
int start = ssb.getSpanStart(span);
|
||||
int end = ssb.getSpanEnd(span);
|
||||
|
||||
for (int i = end - 2; i >= start; i--)
|
||||
if (ssb.charAt(i) == '\n')
|
||||
if (i + 1 < ssb.length() && ssb.charAt(i + 1) == '>')
|
||||
ssb.insert(i + 1, ">");
|
||||
else
|
||||
ssb.insert(i + 1, "> ");
|
||||
|
||||
if (start < ssb.length())
|
||||
ssb.insert(start, ssb.charAt(start) == '>' ? ">" : "> ");
|
||||
}
|
||||
|
||||
return ssb.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user