From 648bb0b5092403620b0b97a4149800861909612e Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 9 Sep 2019 08:43:59 +0200 Subject: [PATCH] Fixed formatting of text only columns --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 10 ++++++++-- 1 file changed, 8 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 794f846110..c1ca18f1e5 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -209,10 +209,16 @@ public class HtmlHelper { // Tables for (Element col : document.select("th,td")) { boolean content = false; - for (Element e : col.children()) - if (!e.isBlock() && hasContent(e)) { + for (Node node : col.childNodes()) + if (node instanceof TextNode) { content = true; break; + } else if (node instanceof Element) { + Element element = (Element) node; + if (!element.isBlock() && hasContent(element)) { + content = true; + break; + } } // separate columns