diff options
author | default <nobody@localhost> | 2023-01-17 09:37:41 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-01-17 09:37:41 +0100 |
commit | b262961c93d933b886db1fb1f7d0273e11b5d282 (patch) | |
tree | b2f2c8225c201d4641d534b0f043884eb106f008 | |
parent | 8e1f4430ff0408fff1b25715d45065afb4f6bd10 (diff) |
Process HTML Unicode entities specially in process_tags().
-rw-r--r-- | activitypub.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c index 97fdc7b..b878bc5 100644 --- a/activitypub.c +++ b/activitypub.c @@ -272,7 +272,7 @@ void process_tags(snac *snac, const char *content, d_char **n_content, d_char ** char *p, *v; int n = 0; - split = xs_regex_split(content, "(@[A-Za-z0-9_]+@[A-Za-z0-9\\.-]+|#[^ ,\\.:;<]+)"); + split = xs_regex_split(content, "(@[A-Za-z0-9_]+@[A-Za-z0-9\\.-]+|&#[0-9]+;|#[^ ,\\.:;<]+)"); p = split; while (xs_list_iter(&p, &v)) { @@ -321,6 +321,13 @@ void process_tags(snac *snac, const char *content, d_char **n_content, d_char ** /* add the code */ nc = xs_str_cat(nc, l); } + else + if (*v == '&') { + /* HTML Unicode entity, probably part of an emoji */ + + /* write as is */ + nc = xs_str_cat(nc, v); + } } else nc = xs_str_cat(nc, v); |