Prevent empty/local image links

This commit is contained in:
M66B 2021-07-07 06:55:08 +02:00
parent 17997b8088
commit b2d37c3964
1 changed files with 5 additions and 2 deletions

View File

@ -1101,9 +1101,12 @@ public class HtmlHelper {
boolean linked = false;
Element p = img.parent();
while (p != null && !linked)
if ("a".equals(p.tagName()))
if ("a".equals(p.tagName())) {
String href = p.attr("href");
if (TextUtils.isEmpty(href) || href.equals("#"))
break;
linked = true;
else
} else
p = p.parent();
if (linked)
alt = context.getString(R.string.title_image_link);