From 33dfbe654f1141d2746c829bf32a864a6d1f0b40 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 8 Nov 2020 13:01:47 +0100 Subject: [PATCH] Fix dangling table elements --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 5 ++++- 1 file changed, 4 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 b0911c5bad..f05b0ab9c3 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -837,8 +837,8 @@ public class HtmlHelper { for (Element child : table.children()) { switch (child.tagName()) { case "thead": - case "tfoot": case "tbody": + case "tfoot": for (Element sub : child.children()) if ("tr".equals(sub.tagName())) { rows.add(sub); @@ -1017,6 +1017,9 @@ public class HtmlHelper { } } + // Fix dangling table elements + document.select("tbody,thead,tfoot,tr,th,td").tagName("div"); + // Images // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img for (Element img : document.select("img")) {