From a9dcf095f663e10072414a329b5f55b608013f38 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 5 Aug 2020 08:18:02 +0200 Subject: [PATCH] Always remove extra newlines from last paragraph --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 6945b2aef1..86c8053e33 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -304,8 +304,8 @@ public class HtmlHelper { static Document fixEdit(Document document) { // Prevent extra newline at end Element body = document.body(); - if (body != null && body.childrenSize() == 1) { - Element holder = body.child(0); + if (body != null && body.childrenSize() > 0) { + Element holder = body.child(body.childrenSize() - 1); if ("p".equals(holder.tagName())) { holder.tagName("span"); int c = holder.childrenSize();