summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--format.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/format.c b/format.c
index 43dd638..1bb2cf1 100644
--- a/format.c
+++ b/format.c
@@ -10,6 +10,7 @@
10#include "xs_match.h" 10#include "xs_match.h"
11 11
12#include "snac.h" 12#include "snac.h"
13#include <string.h>
13 14
14/* emoticons, people laughing and such */ 15/* emoticons, people laughing and such */
15const char *smileys[] = { 16const char *smileys[] = {
@@ -382,11 +383,11 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag
382 const char *k, *v; 383 const char *k, *v;
383 384
384 while (xs_dict_next(d, &k, &v, &c)) { 385 while (xs_dict_next(d, &k, &v, &c)) {
385 const char *t = NULL; 386 const char *t = xs_mime_by_ext(v);
386 387
387 /* is it an URL to an image? */ 388 /* is it an URL to an image? */
388 if (xs_startswith(v, "https:/" "/") && 389 if (xs_startswith(v, "https:/" "/") &&
389 (xs_startswith((t = xs_mime_by_ext(v)), "image/") || strrchr(v, '.') == NULL)) { 390 (xs_startswith(t, "image/") || strcmp(t, "application/octet-stream") == 0)) {
390 if (tag && xs_str_in(s, k) != -1) { 391 if (tag && xs_str_in(s, k) != -1) {
391 /* add the emoji to the tag list */ 392 /* add the emoji to the tag list */
392 xs *e = xs_dict_new(); 393 xs *e = xs_dict_new();