summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/html.c b/html.c
index 428d64e..a70f303 100644
--- a/html.c
+++ b/html.c
@@ -91,8 +91,18 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p
91 const char *u = xs_dict_get(i, "url"); 91 const char *u = xs_dict_get(i, "url");
92 const char *mt = xs_dict_get(i, "mediaType"); 92 const char *mt = xs_dict_get(i, "mediaType");
93 93
94 if (xs_is_string(u) && xs_is_string(mt)) { 94 if (xs_is_string(u)) {
95 if (strcmp(mt, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) 95 // on akkoma instances mediaType is not present.
96 // but we need to to know if the image is an svg or not.
97 // for now, i just use the file extention, which may not be the most reliable...
98 int is_svg = 0;
99 if (xs_is_string(mt)) {
100 is_svg = (strcmp(mt, "image/svg+xml") == 0);
101 } else {
102 is_svg = xs_endswith(u, ".svg");
103 }
104
105 if (is_svg && !xs_is_true(xs_dict_get(srv_config, "enable_svg")))
96 s = xs_replace_i(s, n, ""); 106 s = xs_replace_i(s, n, "");
97 else { 107 else {
98 xs *url = make_url(u, proxy, 0); 108 xs *url = make_url(u, proxy, 0);
@@ -3112,6 +3122,10 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
3112 3122
3113 if (!xs_is_null(c)) { 3123 if (!xs_is_null(c)) {
3114 xs *sc = sanitize(c); 3124 xs *sc = sanitize(c);
3125
3126 // replace shortnames in bio
3127 // bug: this somehow fires twice on one specific user
3128 // @ielenia@ck.catwithaclari.net
3115 sc = replace_shortnames(sc, xs_dict_get(actor, "tag"), 2, proxy); 3129 sc = replace_shortnames(sc, xs_dict_get(actor, "tag"), 2, proxy);
3116 3130
3117 xs_html *snac_content = xs_html_tag("div", 3131 xs_html *snac_content = xs_html_tag("div",