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")); } }