More HTML gabagool.

This commit is contained in:
default 2023-11-28 19:07:29 +01:00
parent d00ee229f7
commit a0ae0885d2

16
html.c
View File

@ -1697,6 +1697,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
/* c contains sanitized HTML */
s = xs_str_cat(s, c);
}
if (strcmp(type, "Question") == 0) { /** question content **/
xs_list *oo = xs_dict_get(msg, "oneOf");
@ -1828,7 +1829,6 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
xs *s1 = xs_html_render(poll);
s = xs_str_cat(s, s1);
}
}
s = xs_str_cat(s, "\n");
@ -1955,11 +1955,17 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
}
/* has this message an audience (i.e., comes from a channel or community)? */
const char *audience = xs_dict_get(msg, "audience");
char *audience = xs_dict_get(msg, "audience");
if (strcmp(type, "Page") == 0 && !xs_is_null(audience)) {
xs *es1 = encode_html(audience);
xs *s1 = xs_fmt("<p>(<a href=\"%s\" title=\"%s\">%s</a>)</p>\n",
audience, L("Source channel or community"), es1);
xs_html *au_tag = xs_html_tag("p",
xs_html_text("("),
xs_html_tag("a",
xs_html_attr("href", audience),
xs_html_attr("title", L("Source channel or community")),
xs_html_text(audience)),
xs_html_text(")"));
xs *s1 = xs_html_render(au_tag);
s = xs_str_cat(s, s1);
}