From c90559f241971698b52be9fc52c8534142d652ff Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 4 Jul 2021 21:22:40 +0200 Subject: [PATCH] Conditional column separator --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 433242bfbe..57639bda6c 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -880,6 +880,7 @@ public class HtmlHelper { for (Element row : table.children()) { row.tagName("div"); + Element separate = null; List merge = new ArrayList<>(); for (Element col : row.children()) { Element next = col.nextElementSibling(); @@ -952,15 +953,18 @@ public class HtmlHelper { //} if (TextUtils.isEmpty(align) || "left".equals(align) || - "start".equals(align)) + "start".equals(align)) { col.removeAttr("x-block"); - else { + if (separate != null) + separate.attr("x-column", "true"); + separate = col; + } else { + separate = null; if ("true".equals(col.attr("x-line-before"))) col.removeAttr("x-line-before"); } - col.tagName("div") - .attr("x-column", "true"); + col.tagName("div"); } if (merge.size() != 0)