diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 774ec04cd7..c43a9cdf4c 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -267,6 +267,14 @@ public class HtmlHelper { // if (br.parent() != null && !hasVisibleContent(br.parent().childNodes())) // br.tagName("span"); + for (Element div : document.select("div")) + if (div.children().select("div").size() == 0 && + hasVisibleContent(div.childNodes())) { + Node last = div.childNode(div.childNodeSize() - 1); + if (last != null && "br".equals(last.nodeName())) + last.remove(); + } + // Paragraphs for (Element p : document.select("p")) { p.appendElement("br");