mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
In sanitize(), delete unsupported HTML tags instead of showing them.
This commit is contained in:
parent
5654960161
commit
b5f63b63fa
1 changed files with 2 additions and 6 deletions
8
format.c
8
format.c
|
@ -224,13 +224,9 @@ xs_str *sanitize(const char *content)
|
||||||
|
|
||||||
s2 = xs_fmt("<%s%s%s%s>",
|
s2 = xs_fmt("<%s%s%s%s>",
|
||||||
v[1] == '/' ? "/" : "", tag, xs_list_len(el) ? " " : "", s3);
|
v[1] == '/' ? "/" : "", tag, xs_list_len(el) ? " " : "", s3);
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* bad tag: escape it */
|
|
||||||
s2 = xs_replace(v, "<", "<");
|
|
||||||
}
|
|
||||||
|
|
||||||
s = xs_str_cat(s, s2);
|
s = xs_str_cat(s, s2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* non-tag */
|
/* non-tag */
|
||||||
|
|
Loading…
Reference in a new issue