From 8ccc0d7b003d5bb839232cac262deed7d3c4ebab Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Thu, 24 Apr 2025 22:27:35 +0000 Subject: Normalise CWs and summaries to fit more *oma usage rather than friendica --- html.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 92921e4..c9a93aa 100644 --- a/html.c +++ b/html.c @@ -2188,11 +2188,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, v = xs_dict_get(msg, "summary"); - /* is it sensitive? */ - if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { - if (xs_is_null(v) || *v == '\0') - v = "..."; - + if (!xs_is_null(v) && *v) { const char *cw = ""; if (user) { @@ -2202,23 +2198,16 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, cw = ""; } + xs_html *summary_tag = xs_html_tag("summary", xs_html_text(v)); + if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { + xs_html_add(summary_tag, xs_html_text(L(" [SENSITIVE CONTENT]"))); + } + snac_content = xs_html_tag("details", xs_html_attr(cw, NULL), - xs_html_tag("summary", - xs_html_text(v), - xs_html_text(L(" [SENSITIVE CONTENT]")))); + summary_tag); } else { - /* print the summary as a header (sites like e.g. Friendica can contain one) */ - if (!has_title && !xs_is_null(v) && *v) { - xs_html_add(snac_content_wrap, - xs_html_tag("h3", - xs_html_attr("class", "snac-entry-title"), - xs_html_text(v))); - - has_title = 1; - } - snac_content = xs_html_tag("div", NULL); } -- cgit v1.2.3