diff options
| -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, | |||
| 1639 | #endif | 1639 | #endif |
| 1640 | 1640 | ||
| 1641 | { | 1641 | { |
| 1642 | const char *content = xs_dict_get(msg, "content"); | 1642 | /** build the content string **/ |
| 1643 | 1643 | ||
| 1644 | xs *c = sanitize(xs_is_null(content) ? "" : content); | 1644 | char *content = xs_dict_get(msg, "content"); |
| 1645 | |||
| 1646 | xs *c = sanitize(xs_is_null(content) ? "" : content); | ||
| 1645 | char *p, *v; | 1647 | char *p, *v; |
| 1646 | 1648 | ||
| 1647 | /* do some tweaks to the content */ | 1649 | /* 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, | |||
| 1693 | } | 1695 | } |
| 1694 | } | 1696 | } |
| 1695 | 1697 | ||
| 1698 | /* c contains sanitized HTML */ | ||
| 1699 | s = xs_str_cat(s, c); | ||
| 1700 | |||
| 1696 | if (strcmp(type, "Question") == 0) { /** question content **/ | 1701 | if (strcmp(type, "Question") == 0) { /** question content **/ |
| 1697 | xs_list *oo = xs_dict_get(msg, "oneOf"); | 1702 | xs_list *oo = xs_dict_get(msg, "oneOf"); |
| 1698 | xs_list *ao = xs_dict_get(msg, "anyOf"); | 1703 | 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, | |||
| 1821 | } | 1826 | } |
| 1822 | 1827 | ||
| 1823 | xs *s1 = xs_html_render(poll); | 1828 | xs *s1 = xs_html_render(poll); |
| 1824 | c = xs_str_cat(c, s1); | 1829 | s = xs_str_cat(s, s1); |
| 1825 | } | 1830 | } |
| 1826 | |||
| 1827 | s = xs_str_cat(s, c); | ||
| 1828 | } | 1831 | } |
| 1829 | 1832 | ||
| 1830 | s = xs_str_cat(s, "\n"); | 1833 | s = xs_str_cat(s, "\n"); |