mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-12 12:03:17 +02:00
Limit quote levels
This commit is contained in:
@@ -277,6 +277,8 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
private static final int RECIPIENTS_WARNING = 10;
|
||||
|
||||
private static final int MAX_QUOTE_LEVEL = 5;
|
||||
|
||||
private static final int REQUEST_CONTACT_TO = 1;
|
||||
private static final int REQUEST_CONTACT_CC = 2;
|
||||
private static final int REQUEST_CONTACT_BCC = 3;
|
||||
@@ -3825,6 +3827,21 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
Element e = d.body();
|
||||
|
||||
// Limit number of nested block quotes
|
||||
boolean quote_limit = prefs.getBoolean("quote_limit", true);
|
||||
if (quote_limit)
|
||||
for (Element bq : e.select("blockquote")) {
|
||||
int level = 1;
|
||||
Element parent = bq.parent();
|
||||
while (parent != null) {
|
||||
if ("blockquote".equals(parent.tagName()))
|
||||
level++;
|
||||
parent = parent.parent();
|
||||
}
|
||||
if (level >= MAX_QUOTE_LEVEL)
|
||||
bq.html("…");
|
||||
}
|
||||
|
||||
// Apply styles
|
||||
List<CSSStyleSheet> sheets = HtmlHelper.parseStyles(d.head().select("style"));
|
||||
for (Element element : e.select("*")) {
|
||||
|
||||
Reference in New Issue
Block a user