From cd7bc4590e3b0811885fe3570c6a5f8681fb7229 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 6 Feb 2020 10:45:52 +0100 Subject: [PATCH] Insert new lines before non block elements --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index fa69a77378..a7c55e5767 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -639,6 +639,10 @@ public class HtmlHelper { // Selective new lines for (Element div : document.select("div")) { + Node prev = div.previousSibling(); + if (prev instanceof Element && !((Element) prev).isBlock()) + div.prependElement("br"); + boolean inline = Boolean.parseBoolean(div.attr("inline")); int childs = div.childNodeSize(); Node last = (childs > 0 ? div.childNode(childs - 1) : null);