Guarantee line break for empty paragraphs

pull/212/head
M66B 3 years ago
parent 276cd473d3
commit f5cb2cab05

@ -1115,19 +1115,11 @@ public class HtmlHelper {
// Paragraphs // Paragraphs
for (Element p : document.select("p")) { for (Element p : document.select("p")) {
p.tagName("div"); p.tagName("div");
if (p.childNodeSize() != 0) { if (TextUtils.isEmpty(p.text())) {
if (p.childNodeSize() == 1) { p.attr("x-line-before", "false");
Node lonely = p.childNode(0); p.attr("x-line-after", "true");
if (lonely instanceof TextNode && } else
"\u00a0".equals(((TextNode) lonely).getWholeText()))
continue;
}
p.attr("x-paragraph", "true"); p.attr("x-paragraph", "true");
if (TextUtils.isEmpty(p.text())) {
p.removeAttr("x-line-before");
p.removeAttr("x-line-after");
}
}
} }
// Short inline quotes // Short inline quotes

Loading…
Cancel
Save