diff options
| author | 2025-05-23 21:22:58 +0000 | |
|---|---|---|
| committer | 2025-05-23 21:22:58 +0000 | |
| commit | 34fa8e335a7418282c9096eb23f2511bd1b896e9 (patch) | |
| tree | e50134c5955fba6e9cb1d0d94df27414ea8cc184 | |
| parent | Modified generated HTML to match my stylesheet ehheh (diff) | |
| download | penes-snac2-34fa8e335a7418282c9096eb23f2511bd1b896e9.tar.gz penes-snac2-34fa8e335a7418282c9096eb23f2511bd1b896e9.tar.xz penes-snac2-34fa8e335a7418282c9096eb23f2511bd1b896e9.zip | |
Do not replace :shortnames: with nothing in case of failure
I prefer seeing :neocat_woozy: rather than nothing
| -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 | } |