mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 03:05:31 +00:00
Pre process inline
This commit is contained in:
parent
1be14d521f
commit
87aae49496
1 changed files with 7 additions and 3 deletions
|
@ -637,17 +637,21 @@ public class HtmlHelper {
|
||||||
}, document);
|
}, document);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Element div : document.select("div")) {
|
||||||
|
boolean inline = Boolean.parseBoolean(div.attr("inline"));
|
||||||
|
if (inline)
|
||||||
|
div.tagName("span");
|
||||||
|
}
|
||||||
|
|
||||||
// Selective new lines
|
// Selective new lines
|
||||||
for (Element div : document.select("div")) {
|
for (Element div : document.select("div")) {
|
||||||
Node prev = div.previousSibling();
|
Node prev = div.previousSibling();
|
||||||
if (prev instanceof Element && !((Element) prev).isBlock())
|
if (prev instanceof Element && !((Element) prev).isBlock())
|
||||||
div.prependElement("br");
|
div.prependElement("br");
|
||||||
|
|
||||||
boolean inline = Boolean.parseBoolean(div.attr("inline"));
|
|
||||||
int childs = div.childNodeSize();
|
int childs = div.childNodeSize();
|
||||||
Node last = (childs > 0 ? div.childNode(childs - 1) : null);
|
Node last = (childs > 0 ? div.childNode(childs - 1) : null);
|
||||||
if (!inline &&
|
if ((last == null || !"div".equals(last.nodeName())) &&
|
||||||
(last == null || !"div".equals(last.nodeName())) &&
|
|
||||||
hasVisibleContent(div.childNodes())) {
|
hasVisibleContent(div.childNodes())) {
|
||||||
div.appendElement("br");
|
div.appendElement("br");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue