summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-01-17 09:37:41 +0100
committerGravatar default2023-01-17 09:37:41 +0100
commitb262961c93d933b886db1fb1f7d0273e11b5d282 (patch)
treeb2f2c8225c201d4641d534b0f043884eb106f008
parentBumped version. (diff)
downloadpenes-snac2-b262961c93d933b886db1fb1f7d0273e11b5d282.tar.gz
penes-snac2-b262961c93d933b886db1fb1f7d0273e11b5d282.tar.xz
penes-snac2-b262961c93d933b886db1fb1f7d0273e11b5d282.zip
Process HTML Unicode entities specially in process_tags().
-rw-r--r--activitypub.c9
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 **
272 char *p, *v; 272 char *p, *v;
273 int n = 0; 273 int n = 0;
274 274
275 split = xs_regex_split(content, "(@[A-Za-z0-9_]+@[A-Za-z0-9\\.-]+|#[^ ,\\.:;<]+)"); 275 split = xs_regex_split(content, "(@[A-Za-z0-9_]+@[A-Za-z0-9\\.-]+|&#[0-9]+;|#[^ ,\\.:;<]+)");
276 276
277 p = split; 277 p = split;
278 while (xs_list_iter(&p, &v)) { 278 while (xs_list_iter(&p, &v)) {
@@ -321,6 +321,13 @@ void process_tags(snac *snac, const char *content, d_char **n_content, d_char **
321 /* add the code */ 321 /* add the code */
322 nc = xs_str_cat(nc, l); 322 nc = xs_str_cat(nc, l);
323 } 323 }
324 else
325 if (*v == '&') {
326 /* HTML Unicode entity, probably part of an emoji */
327
328 /* write as is */
329 nc = xs_str_cat(nc, v);
330 }
324 } 331 }
325 else 332 else
326 nc = xs_str_cat(nc, v); 333 nc = xs_str_cat(nc, v);