Prepend line break if visible content only

This commit is contained in:
M66B 2020-02-06 17:06:09 +01:00
parent 393e3b6c3b
commit ee9b188a55
1 changed files with 1 additions and 1 deletions

View File

@ -646,7 +646,7 @@ public class HtmlHelper {
// Selective new lines
for (Element div : document.select("div")) {
Node prev = div.previousSibling();
if (prev instanceof Element && !((Element) prev).isBlock())
if (prev != null && hasVisibleContent(Arrays.asList(prev)))
div.prependElement("br");
if (hasVisibleContent(div.childNodes()))