diff options
| author | 2025-05-06 03:55:43 +0000 | |
|---|---|---|
| committer | 2025-05-06 03:55:43 +0000 | |
| commit | 6e42d34eab2debc6f0bafba01bb87d5351371858 (patch) | |
| tree | 1682a1f4019f33e9b05a68ff5ad53cbb66640b9b /format.c | |
| parent | Better error handling in xs_webmention_send(). (diff) | |
| parent | cleaned up old changes and outdated comments (diff) | |
| download | snac2-6e42d34eab2debc6f0bafba01bb87d5351371858.tar.gz snac2-6e42d34eab2debc6f0bafba01bb87d5351371858.tar.xz snac2-6e42d34eab2debc6f0bafba01bb87d5351371858.zip | |
Merge pull request 'Display custom emoji in more places' (#343) from dandelions/snac2:emoji-pr into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/343
Diffstat (limited to 'format.c')
| -rw-r--r-- | format.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -405,10 +405,11 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag | |||
| 405 | const char *k, *v; | 405 | const char *k, *v; |
| 406 | 406 | ||
| 407 | while (xs_dict_next(d, &k, &v, &c)) { | 407 | while (xs_dict_next(d, &k, &v, &c)) { |
| 408 | const char *t = NULL; | 408 | const char *t = xs_mime_by_ext(v); |
| 409 | 409 | ||
| 410 | /* is it an URL to an image? */ | 410 | /* is it an URL to an image? */ |
| 411 | if (xs_startswith(v, "https:/" "/") && xs_startswith((t = xs_mime_by_ext(v)), "image/")) { | 411 | if (xs_startswith(v, "https:/" "/") && |
| 412 | (xs_startswith(t, "image/") || strcmp(t, "application/octet-stream") == 0)) { | ||
| 412 | if (tag && xs_str_in(s, k) != -1) { | 413 | if (tag && xs_str_in(s, k) != -1) { |
| 413 | /* add the emoji to the tag list */ | 414 | /* add the emoji to the tag list */ |
| 414 | xs *e = xs_dict_new(); | 415 | xs *e = xs_dict_new(); |