1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Remove br from paragraphs only

This commit is contained in:
M66B 2023-03-06 20:32:30 +01:00
parent 76b199ff45
commit 8836c85a34

View file

@ -1115,8 +1115,9 @@ public class HtmlHelper {
// Breaks
for (Element br : document.select("br")) {
Element parent = br.parent();
Element last = (parent == null ? null : parent.lastElementChild());
if (br == last)
if (parent == null || !"p".equals(parent.tagName()))
continue;
if (br == parent.lastElementChild())
br.remove();
}