diff options
author | default <nobody@localhost> | 2023-11-28 18:56:06 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-11-28 18:56:06 +0100 |
commit | d00ee229f7f6df494cc1070be7c31337922cf5c2 (patch) | |
tree | 98ff846d934a34ed508c4956d668effc8cc7dd92 | |
parent | 6821d3df9fb1dd6c16bafe6f137f6997a5cb0377 (diff) |
More html_entry() tweaks.
-rw-r--r-- | html.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1639,9 +1639,11 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local, #endif { - const char *content = xs_dict_get(msg, "content"); + /** build the content string **/ - xs *c = sanitize(xs_is_null(content) ? "" : content); + char *content = xs_dict_get(msg, "content"); + + xs *c = sanitize(xs_is_null(content) ? "" : content); char *p, *v; /* do some tweaks to the content */ @@ -1693,6 +1695,9 @@ 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"); xs_list *ao = xs_dict_get(msg, "anyOf"); @@ -1821,10 +1826,8 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local, } xs *s1 = xs_html_render(poll); - c = xs_str_cat(c, s1); + s = xs_str_cat(s, s1); } - - s = xs_str_cat(s, c); } s = xs_str_cat(s, "\n"); |