summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-05-30 16:12:08 +0200
committerdefault <nobody@localhost>2024-05-30 16:12:08 +0200
commita5ec96a6da5437cad88487205d62a95f27614bd7 (patch)
tree2df61457b69c26adafed87aca7f1951ca847b513 /html.c
parenta2ee9d802ab0dbb7c7144ea77b8d1bdc86a45f1c (diff)
Added an "Alt..." details just below attachments with them.
The alt text is still also generated as 'alt' and 'name' attributes, but this is more usable from phones and tablets.
Diffstat (limited to 'html.c')
-rw-r--r--html.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/html.c b/html.c
index bacee5b..b50d69e 100644
--- a/html.c
+++ b/html.c
@@ -1891,6 +1891,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
xs_html_tag("a",
xs_html_attr("href", href),
xs_html_text(href))));
+
+ /* do not generate an Alt... */
+ name = NULL;
}
else {
xs_html_add(content_attachments,
@@ -1900,6 +1903,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
xs_html_text(L("Attachment")),
xs_html_text(": "),
xs_html_text(href))));
+
+ /* do not generate an Alt... */
+ name = NULL;
+ }
+
+ if (name != NULL && *name) {
+ xs_html_add(content_attachments,
+ xs_html_tag("p",
+ xs_html_tag("details",
+ xs_html_tag("summary",
+ xs_html_text(L("Alt..."))),
+ xs_html_text(name))));
}
}
}