mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-17 06:23:38 +02:00
Keep quotes in selected text
This commit is contained in:
@@ -3821,6 +3821,22 @@ public class FragmentCompose extends FragmentBase {
|
||||
return FilterResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
|
||||
// Limit number of nested block quotes
|
||||
boolean quote_limit = prefs.getBoolean("quote_limit", false);
|
||||
if (quote_limit &&
|
||||
("reply".equals(action) || "reply_all".equals(action)))
|
||||
for (Element bq : d.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("…");
|
||||
}
|
||||
} else {
|
||||
// Selected text
|
||||
d = Document.createShell("");
|
||||
@@ -3837,22 +3853,6 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
Element e = d.body();
|
||||
|
||||
// Limit number of nested block quotes
|
||||
boolean quote_limit = prefs.getBoolean("quote_limit", false);
|
||||
if (quote_limit &&
|
||||
("reply".equals(action) || "reply_all".equals(action)))
|
||||
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