From 905d56038d7d750585b731c2e36796e425a6a93b Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 8 Jul 2022 07:21:09 +0200 Subject: [PATCH] Suppress title if same as img alt --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 10ef3f32c1..a7d78e90a2 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -1037,8 +1037,12 @@ public class HtmlHelper { if (text_titles) for (Element e : document.select("[title]")) { String title = e.attr("title"); - if (!TextUtils.isEmpty(title)) - e.prependChild(document.createElement("span").text("{" + title + "}")); + if (TextUtils.isEmpty(title)) + continue; + if ("img".equals(e.tagName()) && + title.equals(e.attr("alt"))) + continue; + e.prependChild(document.createElement("span").text("{" + title + "}")); } // Replace headings