From b05653b94bed5fa5a73c4b9d6fbb81a2bdd017c7 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 18 Jun 2019 21:56:34 +0200 Subject: [PATCH] Fix invalid HTML --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 7 ++++++- 1 file changed, 6 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 a507e69198..3ee9a9d35b 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -202,7 +202,12 @@ public class HtmlHelper { row.tagName("span"); document.select("caption").tagName("p"); - document.select("table").tagName("div"); + + for (Element table : document.select("table")) + if (table.parent() != null && "a".equals(table.parent().tagName())) + table.tagName("span"); // // Links cannot contain tables + else + table.tagName("div"); // Lists for (Element li : document.select("li")) {