Check if anchor has content

pull/185/head
M66B 5 years ago
parent e111f8fec5
commit 7014a7e0d7

@ -1310,11 +1310,15 @@ public class HtmlHelper {
return true; return true;
else if (node instanceof Element) { else if (node instanceof Element) {
Element element = (Element) node; Element element = (Element) node;
if (!element.isBlock() && if (element.isBlock())
(element.hasText() || return false;
element.selectFirst("a[href~=.+]") != null || if (element.hasText())
element.selectFirst("img[src~=.+]") != null)) return true;
if (element.selectFirst("img[src~=.+]") != null)
return true; return true;
for (Element a : element.select("a[href~=.+]"))
if (a.childNodes().size() > 0)
return true;
} }
return false; return false;
} }

Loading…
Cancel
Save