mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 21:35:04 +00:00
Process HTML Unicode entities specially in process_tags().
This commit is contained in:
parent
8e1f4430ff
commit
b262961c93
1 changed files with 8 additions and 1 deletions
|
@ -272,7 +272,7 @@ void process_tags(snac *snac, const char *content, d_char **n_content, d_char **
|
||||||
char *p, *v;
|
char *p, *v;
|
||||||
int n = 0;
|
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;
|
p = split;
|
||||||
while (xs_list_iter(&p, &v)) {
|
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 */
|
/* add the code */
|
||||||
nc = xs_str_cat(nc, l);
|
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
|
else
|
||||||
nc = xs_str_cat(nc, v);
|
nc = xs_str_cat(nc, v);
|
||||||
|
|
Loading…
Reference in a new issue