Remove br at end of paragraph

This commit is contained in:
M66B 2023-03-05 23:03:09 +01:00
parent 3917be6c77
commit 6137988040
1 changed files with 8 additions and 0 deletions

View File

@ -1112,6 +1112,14 @@ public class HtmlHelper {
hs.attr("x-line-after", "true");
}
// Breaks
for (Element br : document.select("br")) {
Element parent = br.parent();
Element last = (parent == null ? null : parent.lastElementChild());
if (br == last)
br.remove();
}
// Paragraphs
for (Element p : document.select("p")) {
p.tagName("div");