From 209e3fa00dc8124e2a1537df1f94d75600e31006 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 14 Nov 2020 18:29:55 +0100 Subject: [PATCH] Keep quotes in selected text --- .../eu/faircode/email/FragmentCompose.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index f4fd1e1f8d..ff751bf42b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -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 sheets = HtmlHelper.parseStyles(d.head().select("style")); for (Element element : e.select("*")) {