Skip to content

Commit

Permalink
Fix invalid HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Jun 18, 2019
1 parent 878037e commit b05653b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/eu/faircode/email/HtmlHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ static String sanitize(Context context, String html) {
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")) {
Expand Down

0 comments on commit b05653b

Please sign in to comment.