summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/html.c b/html.c
index a96d21a..1c0530f 100644
--- a/html.c
+++ b/html.c
@@ -3338,10 +3338,11 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
3338 3338
3339 /* content (user bio) */ 3339 /* content (user bio) */
3340 const char *c = xs_dict_get(actor, "summary"); 3340 const char *c = xs_dict_get(actor, "summary");
3341 const xs_val *tag = xs_dict_get(actor, "tag");
3341 3342
3342 if (!xs_is_null(c)) { 3343 if (!xs_is_null(c)) {
3343 xs *sc = sanitize(c); 3344 xs *sc = sanitize(c);
3344 sc = replace_shortnames(sc, xs_dict_get(actor, "tag"), 2, proxy); 3345 sc = replace_shortnames(sc, tag, 2, proxy);
3345 3346
3346 xs_html *snac_content = xs_html_tag("div", 3347 xs_html *snac_content = xs_html_tag("div",
3347 xs_html_attr("class", "snac-content")); 3348 xs_html_attr("class", "snac-content"));
@@ -3371,13 +3372,22 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
3371 3372
3372 if (!xs_is_null(type) && !xs_is_null(name) && 3373 if (!xs_is_null(type) && !xs_is_null(name) &&
3373 !xs_is_null(value) && strcmp(type, "PropertyValue") == 0) { 3374 !xs_is_null(value) && strcmp(type, "PropertyValue") == 0) {
3375 /* both the name and the value can contain emoji */
3376 xs *nam = sanitize(name);
3377 nam = replace_shortnames(nam, tag, 1, proxy);
3378
3379 /* todo: sometimes the value is transmitted as markdown and not html ._. */
3374 xs *val = sanitize(value); 3380 xs *val = sanitize(value);
3375 val = replace_shortnames(val, xs_dict_get(actor, "tag"), 1, proxy); 3381 val = replace_shortnames(val, tag, 1, proxy);
3382
3383 /* delete <p> tags, because some software sends them */
3384 val = xs_replace_i(val, "<p>", "");
3385 val = xs_replace_i(val, "</p>", "");
3376 3386
3377 xs_html_add(snac_metadata, 3387 xs_html_add(snac_metadata,
3378 xs_html_tag("span", 3388 xs_html_tag("span",
3379 xs_html_attr("class", "snac-property-name"), 3389 xs_html_attr("class", "snac-property-name"),
3380 xs_html_text(name)), 3390 xs_html_raw(nam)),
3381 xs_html_text(":"), 3391 xs_html_text(":"),
3382 xs_html_raw("&nbsp;"), 3392 xs_html_raw("&nbsp;"),
3383 xs_html_tag("span", 3393 xs_html_tag("span",