aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-04-10 08:25:35 +0200
committerdefault <nobody@localhost>2025-04-10 08:25:35 +0200
commit32b7fa2fcb8d77cab49f0b17af75669139901859 (patch)
treeae3f99263fc91128713c918d8c8550b37a727b79
parent6f884e0d5d4eb9be41764c5ae16da52fed997e88 (diff)
Shorten link label in Attachments.
-rw-r--r--html.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/html.c b/html.c
index a598038..e303d72 100644
--- a/html.c
+++ b/html.c
@@ -2439,13 +2439,19 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
name = NULL;
}
else {
+ xs *d_href = xs_dup(o_href);
+ if (strlen(d_href) > 64) {
+ d_href[64] = '\0';
+ d_href = xs_str_cat(d_href, "...");
+ }
+
xs_html_add(content_attachments,
xs_html_tag("p",
xs_html_tag("a",
xs_html_attr("href", o_href),
xs_html_text(L("Attachment")),
xs_html_text(": "),
- xs_html_text(o_href))));
+ xs_html_text(d_href))));
/* do not generate an Alt... */
name = NULL;