From c61c2895bcfff11e1c6d4e1eb9b7f16fce22faab Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Fri, 23 May 2025 21:22:58 +0000 Subject: Do not replace :shortnames: with nothing in case of failure I prefer seeing :neocat_woozy: rather than nothing --- html.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 60cdb1c..fcf9a95 100644 --- a/html.c +++ b/html.c @@ -99,9 +99,7 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p if (!xs_is_string(mt)) mt = xs_mime_by_ext(u); - if (strcmp(mt, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) - s = xs_replace_i(s, n, ""); - else { + if (strcmp(mt, "image/svg+xml") != 0 || xs_is_true(xs_dict_get(srv_config, "enable_svg"))) { xs *url = make_url(u, proxy, 0); xs_html *img = xs_html_sctag("img", @@ -116,8 +114,6 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p s = xs_replace_i(s, n, s1); } } - else - s = xs_replace_i(s, n, ""); } } } -- cgit v1.2.3