From c4e366ce9fc7ea6e970cb8f4af1a87ecd9d77c18 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 10 Nov 2020 09:57:08 +0100 Subject: [PATCH] Small improvement --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 05e8511549..67ba1d0f7b 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -843,7 +843,12 @@ public class HtmlHelper { List merge = new ArrayList<>(); for (Element col : row.children()) { Element next = col.nextElementSibling(); - if (col.childNodeSize() == 1) { + + // Merge single images into next column + if (col.childNodeSize() == 1 && + (next == null || + next.attr("x-align") + .equals(col.attr("x-align")))) { Node lonely = col.childNode(0); if (lonely instanceof Element && "img".equals(lonely.nodeName())) { @@ -870,6 +875,7 @@ public class HtmlHelper { col.appendChild(strong); } + // Flow not / left aligned columns String align = col.attr("x-align"); if (TextUtils.isEmpty(align) || "left".equals(align) ||