From 553ef7b40c605abff06a138f76917e67eff17526 Mon Sep 17 00:00:00 2001
From: Haijo7
Date: Fri, 16 Jun 2023 15:31:40 +0200
Subject: added titles to images and emojis
---
html.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'html.c')
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("
", 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(
- "
\n",
- url, url, xs_is_null(name) ? "" : name);
+ "
\n",
+ url, url, name, name);
s = xs_str_cat(s, s1);
}
--
cgit v1.2.3