summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-11-20 18:50:42 +0100
committerdefault <nobody@localhost>2023-11-20 18:50:42 +0100
commit7dd1c8a1ba4ff56b2d810f42909ac391ab5b091a (patch)
tree4114216ddb8aef367e5894da15354a48efec4f6a /html.c
parentbc5d0d4ed09833640856ee0193a53553dbb1eb20 (diff)
Use xs_html in html_footer().
Diffstat (limited to 'html.c')
-rw-r--r--html.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/html.c b/html.c
index 4673130..3472cd4 100644
--- a/html.c
+++ b/html.c
@@ -144,11 +144,9 @@ xs_str *html_actor_icon(xs_str *os, char *actor,
if (!xs_is_null(udate)) {
xs *sd = xs_crop_i(xs_dup(udate), 0, 10);
- date_label = xs_str_cat(date_label, " / ");
- date_label = xs_str_cat(date_label, sd);
+ date_label = xs_str_cat(date_label, " / ", sd);
- date_title = xs_str_cat(date_title, " / ");
- date_title = xs_str_cat(date_title, udate);
+ date_title = xs_str_cat(date_title, " / ", udate);
}
xs *edt = encode_html(date_title);
@@ -1531,17 +1529,22 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
xs_str *html_footer(xs_str *s)
{
- xs *s1 = xs_fmt(
- "<div class=\"snac-footer\">\n"
- "<a href=\"%s\">%s</a> - "
- "powered by <a href=\"%s\">"
- "<abbr title=\"Social Networks Are Crap\">snac</abbr></a></div>\n",
- srv_baseurl,
- L("about this site"),
- WHAT_IS_SNAC_URL
- );
-
- return xs_str_cat(s, s1);
+ xs_html *footer = xs_html_tag("div",
+ xs_html_attr("class", "snac-footer"),
+ xs_html_tag("a",
+ xs_html_attr("href", srv_baseurl),
+ xs_html_text(L("about this site"))),
+ xs_html_text(" - "),
+ xs_html_text(L("powered by ")),
+ xs_html_tag("a",
+ xs_html_attr("href", WHAT_IS_SNAC_URL),
+ xs_html_tag("abbr",
+ xs_html_attr("title", "Social Network Are Crap"),
+ xs_html_text("snac"))));
+
+ xs *s1 = xs_html_render(footer);
+
+ return xs_str_cat(s, s1, "\n");
}