Fixed list margins

This commit is contained in:
M66B 2020-11-17 14:33:55 +01:00
parent 587299aa9a
commit 92513fca31
1 changed files with 14 additions and 0 deletions

View File

@ -953,6 +953,20 @@ public class HtmlHelper {
// Fix dangling table elements
document.select("tr,th,td").tagName("div");
// Lists
for (Element e : document.select("ol,ul")) {
if (view) {
if (!"false".equals(e.attr("x-line-before")))
e.attr("x-line-before", "true");
if (!"false".equals(e.attr("x-line-after")))
e.attr("x-line-after", "true");
} else {
String style = e.attr("style");
e.attr("style",
mergeStyles(style, "margin:0"));
}
}
// Images
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
for (Element img : document.select("img")) {