|
|
|
@ -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("*")) {
|
|
|
|
|