Process padding top/bottom

This commit is contained in:
M66B
2020-04-13 19:31:02 +02:00
parent 117ddf1e51
commit 6b9b1d6c32

View File

@@ -501,6 +501,22 @@ public class HtmlHelper {
}
}
break;
case "padding-top":
if (element.isBlock()) {
Float pt = getFontSize(value, null);
if (pt != null && pt >= 0.5)
element.attr("line", "before");
}
break;
case "padding-bottom":
if (element.isBlock()) {
Float pb = getFontSize(value, null);
if (pb != null && pb >= 0.5)
element.attr("line", "after");
}
break;
}
}
}
@@ -782,6 +798,14 @@ public class HtmlHelper {
for (Element div : document.select("div"))
div.tagName("span");
for (Element e : document.select("*[line=before]"))
if (hasVisibleContent(e.childNodes()))
e.prependElement("br");
for (Element e : document.select("*[line=after]"))
if (hasVisibleContent(e.childNodes()))
e.appendElement("br");
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
for (Element span : document.select("span"))
if (!TextUtils.isEmpty(span.attr("color")))