commit 7dd1c8a
default
·
2023-11-20 17:50:42 +0000 UTC
parent bc5d0d4
Use xs_html in html_footer().
1 files changed,
+18,
-15
M
html.c
M
html.c
+18,
-15
1@@ -144,11 +144,9 @@ xs_str *html_actor_icon(xs_str *os, char *actor,
2 if (!xs_is_null(udate)) {
3 xs *sd = xs_crop_i(xs_dup(udate), 0, 10);
4
5- date_label = xs_str_cat(date_label, " / ");
6- date_label = xs_str_cat(date_label, sd);
7+ date_label = xs_str_cat(date_label, " / ", sd);
8
9- date_title = xs_str_cat(date_title, " / ");
10- date_title = xs_str_cat(date_title, udate);
11+ date_title = xs_str_cat(date_title, " / ", udate);
12 }
13
14 xs *edt = encode_html(date_title);
15@@ -1531,17 +1529,22 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
16
17 xs_str *html_footer(xs_str *s)
18 {
19- xs *s1 = xs_fmt(
20- "<div class=\"snac-footer\">\n"
21- "<a href=\"%s\">%s</a> - "
22- "powered by <a href=\"%s\">"
23- "<abbr title=\"Social Networks Are Crap\">snac</abbr></a></div>\n",
24- srv_baseurl,
25- L("about this site"),
26- WHAT_IS_SNAC_URL
27- );
28-
29- return xs_str_cat(s, s1);
30+ xs_html *footer = xs_html_tag("div",
31+ xs_html_attr("class", "snac-footer"),
32+ xs_html_tag("a",
33+ xs_html_attr("href", srv_baseurl),
34+ xs_html_text(L("about this site"))),
35+ xs_html_text(" - "),
36+ xs_html_text(L("powered by ")),
37+ xs_html_tag("a",
38+ xs_html_attr("href", WHAT_IS_SNAC_URL),
39+ xs_html_tag("abbr",
40+ xs_html_attr("title", "Social Network Are Crap"),
41+ xs_html_text("snac"))));
42+
43+ xs *s1 = xs_html_render(footer);
44+
45+ return xs_str_cat(s, s1, "\n");
46 }
47
48