Insert new lines before non block elements

This commit is contained in:
M66B 2020-02-06 10:45:52 +01:00
parent c7b9a239e7
commit cd7bc4590e
1 changed files with 4 additions and 0 deletions

View File

@ -639,6 +639,10 @@ public class HtmlHelper {
// Selective new lines
for (Element div : document.select("div")) {
Node prev = div.previousSibling();
if (prev instanceof Element && !((Element) prev).isBlock())
div.prependElement("br");
boolean inline = Boolean.parseBoolean(div.attr("inline"));
int childs = div.childNodeSize();
Node last = (childs > 0 ? div.childNode(childs - 1) : null);