summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-16 17:11:32 +0200
committerdefault <nobody@localhost>2023-06-16 17:11:32 +0200
commit98d49bab25c6d79d2bdda0f9ee7ae131b85114c0 (patch)
treeba1d15fe9f1636ae4f2bf1809657e2571df6d4f2 /html.c
parenta260f5fec314a260bcaccf67e3d737bf5b153c38 (diff)
parent4b75b2a75fcd0b5e8d6de155ac38a70b29fc81fb (diff)
Merge branch 'master' of grunfink-codeberg:grunfink/snac2
Diffstat (limited to 'html.c')
-rw-r--r--html.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/html.c b/html.c
index 9f9737a..5aacf7d 100644
--- a/html.c
+++ b/html.c
@@ -967,7 +967,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
if (n && i) {
char *u = xs_dict_get(i, "url");
xs *img = xs_fmt("<img src=\"%s\" style=\"height: 1em\" "
- "loading=\"lazy\"/>", u);
+ "loading=\"lazy\" title=\"%s\"/>", u, n);
c = xs_replace_i(c, n, img);
}
@@ -1073,9 +1073,11 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
char *name = xs_dict_get(v, "name");
if (url != NULL) {
+ if (xs_is_null(name))
+ name = "";
xs *s1 = xs_fmt(
- "<a href=\"%s\" target=\"_blank\"><img src=\"%s\" alt=\"%s\" loading=\"lazy\"/></a>\n",
- url, url, xs_is_null(name) ? "" : name);
+ "<a href=\"%s\" target=\"_blank\"><img src=\"%s\" alt=\"%s\" title=\"%s\" loading=\"lazy\"/></a>\n",
+ url, url, name, name);
s = xs_str_cat(s, s1);
}