mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Keep quotes in selected text
This commit is contained in:
parent
ce30a3daf7
commit
209e3fa00d
1 changed files with 16 additions and 16 deletions
|
@ -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("*")) {
|
||||
|
|
Loading…
Reference in a new issue