mirror of https://github.com/M66B/FairEmail.git
Optimization
This commit is contained in:
parent
73b5309e51
commit
9674490099
|
@ -1112,18 +1112,14 @@ public class HtmlHelper {
|
||||||
hs.attr("x-line-after", "true");
|
hs.attr("x-line-after", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Breaks
|
|
||||||
for (Element br : document.select("br")) {
|
|
||||||
Element parent = br.parent();
|
|
||||||
if (parent == null || !"p".equals(parent.tagName()))
|
|
||||||
continue;
|
|
||||||
if (br == parent.lastElementChild())
|
|
||||||
br.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paragraphs
|
// Paragraphs
|
||||||
for (Element p : document.select("p")) {
|
for (Element p : document.select("p")) {
|
||||||
p.tagName("div");
|
p.tagName("div");
|
||||||
|
|
||||||
|
Element last = p.lastElementChild();
|
||||||
|
if (last != null && "br".equals(last.tagName()))
|
||||||
|
last.remove();
|
||||||
|
|
||||||
if (TextUtils.isEmpty(p.text())) {
|
if (TextUtils.isEmpty(p.text())) {
|
||||||
p.attr("x-line-before", "false");
|
p.attr("x-line-before", "false");
|
||||||
p.attr("x-line-after", "true");
|
p.attr("x-line-after", "true");
|
||||||
|
|
Loading…
Reference in New Issue