From ea84f158aa2e001200763bc1c3fca9515e0a5aef Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 20 Sep 2022 10:03:46 +0200 Subject: [PATCH] Remove signatures from text to be translated --- .../main/java/eu/faircode/email/FragmentDialogTranslate.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java b/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java index 030513b890..c1ef1fdfa8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java @@ -350,6 +350,11 @@ public class FragmentDialogTranslate extends FragmentDialogBase { String html = Helper.readText(file); Document d = HtmlHelper.sanitizeCompose(context, html, false); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + boolean remove_signatures = prefs.getBoolean("remove_signatures", false); + if (remove_signatures) + HtmlHelper.removeSignatures(d); + d.select("blockquote").remove(); HtmlHelper.truncate(d, HtmlHelper.MAX_TRANSLATABLE_TEXT_SIZE);