Always remove extra newlines from last paragraph

This commit is contained in:
M66B 2020-08-05 08:18:02 +02:00
parent b2df1d16a6
commit a9dcf095f6
1 changed files with 2 additions and 2 deletions

View File

@ -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();