mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-30 19:56:10 +00:00
Made div with br a special case
This commit is contained in:
parent
a6f2101352
commit
61408dfd02
1 changed files with 6 additions and 4 deletions
|
@ -293,12 +293,14 @@ public class HtmlHelper {
|
||||||
}
|
}
|
||||||
}, document);
|
}, document);
|
||||||
|
|
||||||
|
// Prevent too many line breaks
|
||||||
|
for (Element div : document.select("div"))
|
||||||
|
if (div.children().size() == div.select("br").size())
|
||||||
|
div.tagName("span");
|
||||||
|
|
||||||
// Remove block elements displaying nothing
|
// Remove block elements displaying nothing
|
||||||
for (Element e : document.select("*"))
|
for (Element e : document.select("*"))
|
||||||
if (e.isBlock() &&
|
if (e.isBlock() && !e.hasText() && e.select("img").size() == 0)
|
||||||
!e.hasText() &&
|
|
||||||
e.select("br").size() == 0 &&
|
|
||||||
e.select("img").size() == 0)
|
|
||||||
e.remove();
|
e.remove();
|
||||||
|
|
||||||
// Prevent too many line breaks
|
// Prevent too many line breaks
|
||||||
|
|
Loading…
Reference in a new issue