diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 14 |
1 files changed, 8 insertions, 6 deletions
| @@ -91,10 +91,14 @@ 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 | if (!xs_is_string(mt)) |
| 96 | s = xs_replace_i(s, n, ""); | 96 | mt = xs_mime_by_ext(u); |
| 97 | else { | 97 | |
| 98 | if (!xs_startswith(mt, "image/")) | ||
| 99 | continue; | ||
| 100 | |||
| 101 | if (strcmp(mt, "image/svg+xml") != 0 || xs_is_true(xs_dict_get(srv_config, "enable_svg"))) { | ||
| 98 | xs *url = make_url(u, proxy, 0); | 102 | xs *url = make_url(u, proxy, 0); |
| 99 | 103 | ||
| 100 | xs_html *img = xs_html_sctag("img", | 104 | xs_html *img = xs_html_sctag("img", |
| @@ -109,8 +113,6 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p | |||
| 109 | s = xs_replace_i(s, n, s1); | 113 | s = xs_replace_i(s, n, s1); |
| 110 | } | 114 | } |
| 111 | } | 115 | } |
| 112 | else | ||
| 113 | s = xs_replace_i(s, n, ""); | ||
| 114 | } | 116 | } |
| 115 | } | 117 | } |
| 116 | } | 118 | } |