From 655f0e3d3bd72c54ee585e2f8e512d74a1fa2340 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 30 Jun 2019 09:51:43 +0200 Subject: [PATCH] Suppress more white space --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 13 ++++++++++++- 1 file changed, 12 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 408e924a2e..220f31af1f 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -188,6 +188,17 @@ public class HtmlHelper { document.select("ul").tagName("div"); // Tables + for (Element div : document.select("div")) { + Element parent = div.parent(); + while (parent != null) { + if ("td".equals(parent.tagName())) { + div.tagName("span"); // Prevent white space + break; + } + parent = parent.parent(); + } + } + for (Element col : document.select("th,td")) { // separate columns by a space if (col.nextElementSibling() == null) { @@ -209,7 +220,7 @@ public class HtmlHelper { for (Element table : document.select("table")) if (table.parent() != null && "a".equals(table.parent().tagName())) - table.tagName("span"); // // Links cannot contain tables + table.tagName("span"); // Links cannot contain tables else table.tagName("div");