diff options
| author | 2023-06-16 17:11:32 +0200 | |
|---|---|---|
| committer | 2023-06-16 17:11:32 +0200 | |
| commit | 98d49bab25c6d79d2bdda0f9ee7ae131b85114c0 (patch) | |
| tree | ba1d15fe9f1636ae4f2bf1809657e2571df6d4f2 /html.c | |
| parent | Increased debug level for NOT collecting inboxes. (diff) | |
| parent | Merge pull request 'added titles to images and emojis' (#54) from Haijo7/snac... (diff) | |
| download | snac2-98d49bab25c6d79d2bdda0f9ee7ae131b85114c0.tar.gz snac2-98d49bab25c6d79d2bdda0f9ee7ae131b85114c0.tar.xz snac2-98d49bab25c6d79d2bdda0f9ee7ae131b85114c0.zip | |
Merge branch 'master' of grunfink-codeberg:grunfink/snac2
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -967,7 +967,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, | |||
| 967 | if (n && i) { | 967 | if (n && i) { |
| 968 | char *u = xs_dict_get(i, "url"); | 968 | char *u = xs_dict_get(i, "url"); |
| 969 | xs *img = xs_fmt("<img src=\"%s\" style=\"height: 1em\" " | 969 | xs *img = xs_fmt("<img src=\"%s\" style=\"height: 1em\" " |
| 970 | "loading=\"lazy\"/>", u); | 970 | "loading=\"lazy\" title=\"%s\"/>", u, n); |
| 971 | 971 | ||
| 972 | c = xs_replace_i(c, n, img); | 972 | c = xs_replace_i(c, n, img); |
| 973 | } | 973 | } |
| @@ -1073,9 +1073,11 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, | |||
| 1073 | char *name = xs_dict_get(v, "name"); | 1073 | char *name = xs_dict_get(v, "name"); |
| 1074 | 1074 | ||
| 1075 | if (url != NULL) { | 1075 | if (url != NULL) { |
| 1076 | if (xs_is_null(name)) | ||
| 1077 | name = ""; | ||
| 1076 | xs *s1 = xs_fmt( | 1078 | xs *s1 = xs_fmt( |
| 1077 | "<a href=\"%s\" target=\"_blank\"><img src=\"%s\" alt=\"%s\" loading=\"lazy\"/></a>\n", | 1079 | "<a href=\"%s\" target=\"_blank\"><img src=\"%s\" alt=\"%s\" title=\"%s\" loading=\"lazy\"/></a>\n", |
| 1078 | url, url, xs_is_null(name) ? "" : name); | 1080 | url, url, name, name); |
| 1079 | 1081 | ||
| 1080 | s = xs_str_cat(s, s1); | 1082 | s = xs_str_cat(s, s1); |
| 1081 | } | 1083 | } |