mirror of https://github.com/M66B/FairEmail.git
Check if anchor has content
This commit is contained in:
parent
e111f8fec5
commit
7014a7e0d7
|
@ -1310,11 +1310,15 @@ public class HtmlHelper {
|
|||
return true;
|
||||
else if (node instanceof Element) {
|
||||
Element element = (Element) node;
|
||||
if (!element.isBlock() &&
|
||||
(element.hasText() ||
|
||||
element.selectFirst("a[href~=.+]") != null ||
|
||||
element.selectFirst("img[src~=.+]") != null))
|
||||
if (element.isBlock())
|
||||
return false;
|
||||
if (element.hasText())
|
||||
return true;
|
||||
if (element.selectFirst("img[src~=.+]") != null)
|
||||
return true;
|
||||
for (Element a : element.select("a[href~=.+]"))
|
||||
if (a.childNodes().size() > 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue