Skip to content

Commit afac279

Browse files
committed
fixed: link suffix appended to empty links
1 parent 90a5d54 commit afac279

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

views/default/js/target_blank/target_blank.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ define(function(require) {
1717

1818
if (suffix) {
1919
$(selector).each(function() {
20-
if (!$(this).find(" > img").length) {
21-
$(this).append(suffix);
20+
if ($(this).find(" > img").length) {
21+
// there is an image in the link
22+
return;
2223
}
24+
25+
if (!$(this).html().length) {
26+
// there is no content in the anchor
27+
return;
28+
}
29+
30+
$(this).append(suffix);
2331
});
2432
}
2533
});

0 commit comments

Comments
 (0)