diff options
| author | 2025-05-23 21:22:58 +0000 | |
|---|---|---|
| committer | 2025-11-02 06:24:02 +0000 | |
| commit | 4491bad57bafce881bb2bc0b3807c15436916850 (patch) | |
| tree | 5fdf0f916a565e016487ddf011f75295481db766 /html.c | |
| parent | Modified generated HTML to match my stylesheet ehheh (diff) | |
| download | penes-snac2-4491bad57bafce881bb2bc0b3807c15436916850.tar.gz penes-snac2-4491bad57bafce881bb2bc0b3807c15436916850.tar.xz penes-snac2-4491bad57bafce881bb2bc0b3807c15436916850.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
| @@ -99,9 +99,7 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *p | |||
| 99 | if (!xs_is_string(mt)) | 99 | if (!xs_is_string(mt)) |
| 100 | mt = xs_mime_by_ext(u); | 100 | mt = xs_mime_by_ext(u); |
| 101 | 101 | ||
| 102 | if (strcmp(mt, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) | 102 | if (strcmp(mt, "image/svg+xml") != 0 || xs_is_true(xs_dict_get(srv_config, "enable_svg"))) { |
| 103 | s = xs_replace_i(s, n, ""); | ||
| 104 | else { | ||
| 105 | xs *url = make_url(u, proxy, 0); | 103 | xs *url = make_url(u, proxy, 0); |
| 106 | 104 | ||
| 107 | xs_html *img = xs_html_sctag("img", | 105 | 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 | |||
| 116 | s = xs_replace_i(s, n, s1); | 114 | s = xs_replace_i(s, n, s1); |
| 117 | } | 115 | } |
| 118 | } | 116 | } |
| 119 | else | ||
| 120 | s = xs_replace_i(s, n, ""); | ||
| 121 | } | 117 | } |
| 122 | } | 118 | } |
| 123 | } | 119 | } |