mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-27 09:33:40 +00:00
Merge branch 'master' of grunfink-codeberg:grunfink/snac2
This commit is contained in:
commit
98d49bab25
1 changed files with 5 additions and 3 deletions
8
html.c
8
html.c
|
@ -967,7 +967,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
|
||||||
if (n && i) {
|
if (n && i) {
|
||||||
char *u = xs_dict_get(i, "url");
|
char *u = xs_dict_get(i, "url");
|
||||||
xs *img = xs_fmt("<img src=\"%s\" style=\"height: 1em\" "
|
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);
|
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");
|
char *name = xs_dict_get(v, "name");
|
||||||
|
|
||||||
if (url != NULL) {
|
if (url != NULL) {
|
||||||
|
if (xs_is_null(name))
|
||||||
|
name = "";
|
||||||
xs *s1 = xs_fmt(
|
xs *s1 = xs_fmt(
|
||||||
"<a href=\"%s\" target=\"_blank\"><img src=\"%s\" alt=\"%s\" loading=\"lazy\"/></a>\n",
|
"<a href=\"%s\" target=\"_blank\"><img src=\"%s\" alt=\"%s\" title=\"%s\" loading=\"lazy\"/></a>\n",
|
||||||
url, url, xs_is_null(name) ? "" : name);
|
url, url, name, name);
|
||||||
|
|
||||||
s = xs_str_cat(s, s1);
|
s = xs_str_cat(s, s1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue