From 66cbb9dc769395771eb84d1cdfc0509c794d1c6c Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 10 Mar 2020 08:29:18 +0100 Subject: [PATCH] Fixed missing new lines --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 7e180f1779..fdfd4ab9f2 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -84,11 +84,6 @@ public class HtmlHelper { private static final int MAX_FULL_TEXT_SIZE = 1024 * 1024; // characters private static final int TRACKING_PIXEL_SURFACE = 25; // pixels - private static final List heads = Collections.unmodifiableList(Arrays.asList( - "h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "table", "br", "hr")); - private static final List tails = Collections.unmodifiableList(Arrays.asList( - "h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "li")); - private static final HashMap x11ColorMap = new HashMap<>(); static { @@ -1180,6 +1175,11 @@ public class HtmlHelper { private int plevel = 0; private int lindex = 0; + private final List heads = Collections.unmodifiableList(Arrays.asList( + "h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "table", "br", "hr")); + private final List tails = Collections.unmodifiableList(Arrays.asList( + "h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "li")); + public void head(Node node, int depth) { if (node instanceof TextNode) if (plevel > 0) { @@ -1295,7 +1295,8 @@ public class HtmlHelper { } p.tagName("div"); - p.appendElement("br"); + if (p.parent() != null) + p.after(document.createElement("br")); } }