summaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'format.c')
-rw-r--r--format.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/format.c b/format.c
index 803e5a5..95c1b12 100644
--- a/format.c
+++ b/format.c
@@ -79,6 +79,24 @@ xs_dict *emojis(void)
79 return d; 79 return d;
80} 80}
81 81
82
83xs_dict *emojis_rm_categories() {
84 xs *emjs = emojis();
85 char *res = xs_dict_new();
86 const char *k, *v;
87 xs_dict_foreach(emjs, k, v) {
88 if (xs_type(v) == XSTYPE_DICT) {
89 const char *v2;
90 xs_dict_foreach(v, k, v2)
91 res = xs_dict_append(res, k, v2);
92 }
93 else
94 res = xs_dict_append(res, k, v);
95 }
96 return res;
97}
98
99
82/* Non-whitespace without trailing comma, period or closing paren */ 100/* Non-whitespace without trailing comma, period or closing paren */
83#define NOSPACE "([^[:space:],.)]+|[,.)]+[^[:space:],.)])+" 101#define NOSPACE "([^[:space:],.)]+|[,.)]+[^[:space:],.)])+"
84 102
@@ -405,7 +423,7 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag
405 423
406 { 424 {
407 /* traditional emoticons */ 425 /* traditional emoticons */
408 xs *d = emojis(); 426 xs *d = emojis_rm_categories();
409 int c = 0; 427 int c = 0;
410 const char *k, *v; 428 const char *k, *v;
411 429