diff options
| author | 2025-05-23 21:22:58 +0000 | |
|---|---|---|
| committer | 2025-11-02 06:35:55 +0000 | |
| commit | 86714c52a1efb9fddb2c236047b6b555e32852de (patch) | |
| tree | b4782c47dc3d779e6c7a805c72df540eaf4d0555 /html.c | |
| parent | Modified generated HTML to match my stylesheet ehheh (diff) | |
| download | penes-snac2-86714c52a1efb9fddb2c236047b6b555e32852de.tar.gz penes-snac2-86714c52a1efb9fddb2c236047b6b555e32852de.tar.xz penes-snac2-86714c52a1efb9fddb2c236047b6b555e32852de.zip | |
Do not replace :shortnames: with nothing in case of failure
I prefer seeing :neocat_woozy: rather than nothing
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 6 |
1 files changed, 1 insertions, 5 deletions
| @@ -100,9 +100,7 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p | |||
| 100 | if (!xs_is_string(mt)) | 100 | if (!xs_is_string(mt)) |
| 101 | mt = xs_mime_by_ext(u); | 101 | mt = xs_mime_by_ext(u); |
| 102 | 102 | ||
| 103 | if (strcmp(mt, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) | 103 | if (strcmp(mt, "image/svg+xml") != 0 || xs_is_true(xs_dict_get(srv_config, "enable_svg"))) { |
| 104 | s = xs_replace_i(s, n, ""); | ||
| 105 | else { | ||
| 106 | xs *url = make_url(u, proxy, 0); | 104 | xs *url = make_url(u, proxy, 0); |
| 107 | 105 | ||
| 108 | xs_html *img = xs_html_sctag("img", | 106 | xs_html *img = xs_html_sctag("img", |
| @@ -117,8 +115,6 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p | |||
| 117 | s = xs_replace_i(s, n, s1); | 115 | s = xs_replace_i(s, n, s1); |
| 118 | } | 116 | } |
| 119 | } | 117 | } |
| 120 | else | ||
| 121 | s = xs_replace_i(s, n, ""); | ||
| 122 | } | 118 | } |
| 123 | } | 119 | } |
| 124 | } | 120 | } |