aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-01-12 06:14:58 +0100
committergrunfink <grunfink@comam.es>2026-01-12 06:14:58 +0100
commita84e74e8f22e0be502d1b4b98cadaf284db5af23 (patch)
tree5ee4cb156d2900d6729093ad4f03275b7bb5c23e /html.c
parentde9d546d70cfcbf3b2450b70039470c9a68ecdc6 (diff)
Move the pronouns closer to the account name.
Diffstat (limited to 'html.c')
-rw-r--r--html.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/html.c b/html.c
index 2107609..2ff6f79 100644
--- a/html.c
+++ b/html.c
@@ -222,9 +222,6 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
xs *name = actor_name(actor, proxy);
xs *pronouns = actor_pronouns(actor);
- char pronouns_c = 0;
- if (*pronouns != '\0')
- pronouns_c = 1;
/* get the avatar */
if ((v = xs_dict_get(actor, "icon")) != NULL) {
@@ -259,16 +256,28 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
if (href == NULL)
href = xs_dup(actor_id);
+ xs_html *name_link = xs_html_tag("a",
+ xs_html_attr("href", href),
+ xs_html_attr("class", "p-author h-card snac-author"),
+ xs_html_raw(name)); /* name is already html-escaped */
+
+ if (*pronouns) {
+ xs_html_add(name_link,
+ xs_html_text(" ["),
+ xs_html_tag("span",
+ xs_html_attr("class", "snac-pronouns"),
+ xs_html_attr("title", "user's pronouns"),
+ xs_html_raw(pronouns)),
+ xs_html_text("]"));
+ }
+
xs_html_add(actor_icon,
xs_html_sctag("img",
xs_html_attr("loading", "lazy"),
xs_html_attr("class", "snac-avatar"),
xs_html_attr("src", avatar),
xs_html_attr("alt", "[?]")),
- xs_html_tag("a",
- xs_html_attr("href", href),
- xs_html_attr("class", "p-author h-card snac-author"),
- xs_html_raw(name))); /* name is already html-escaped */
+ name_link);
if (!xs_is_null(url)) {
xs *md5 = xs_md5_hex(url, strlen(url));
@@ -281,14 +290,6 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
xs_html_text("ยป")));
}
- if (pronouns_c > 0)
- xs_html_add(actor_icon,
- xs_html_text(" "),
- xs_html_tag("span",
- xs_html_attr("class", "snac-pronouns"),
- xs_html_attr("title", "user's pronouns"),
- xs_html_raw(pronouns)));
-
if (strcmp(xs_dict_get(actor, "type"), "Service") == 0) {
xs_html_add(actor_icon,