From 28a7d33ba0e92c310b912d7cb379ef286afa4bc0 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 11 Feb 2019 08:35:03 +0000 Subject: [PATCH] Fixed image links --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index aa1bac7218..1062af921f 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -82,6 +82,8 @@ public class HtmlHelper { ol.append("
"); for (Element img : document.select("img")) { + img.prependElement("br"); + boolean linked = false; for (Element parent : img.parents()) if ("a".equals(parent.tagName())) { @@ -93,18 +95,12 @@ public class HtmlHelper { if (src.startsWith("http://") || src.startsWith("https://")) { Element a = document.createElement("a"); a.attr("href", src); + a.appendChild(img.clone()); img.replaceWith(a); - a.appendChild(img); } } } - for (Element img : document.select("img")) { - Element p = document.createElement("p"); - img.replaceWith(p); - p.appendChild(img); - } - if (!showQuotes) for (Element quote : document.select("blockquote")) quote.html("…");