diff options
| author | 2023-06-13 19:00:26 +0200 | |
|---|---|---|
| committer | 2023-06-13 19:00:26 +0200 | |
| commit | b5f63b63fac94a7cfa91ad8149f9669a56150378 (patch) | |
| tree | 9f14b49b42539f10bf018dad0642bc34e21551e6 /format.c | |
| parent | Also accept HTML tag <ol>. (diff) | |
| download | penes-snac2-b5f63b63fac94a7cfa91ad8149f9669a56150378.tar.gz penes-snac2-b5f63b63fac94a7cfa91ad8149f9669a56150378.tar.xz penes-snac2-b5f63b63fac94a7cfa91ad8149f9669a56150378.zip | |
In sanitize(), delete unsupported HTML tags instead of showing them.
Diffstat (limited to 'format.c')
| -rw-r--r-- | format.c | 8 |
1 files changed, 2 insertions, 6 deletions
| @@ -224,13 +224,9 @@ xs_str *sanitize(const char *content) | |||
| 224 | 224 | ||
| 225 | s2 = xs_fmt("<%s%s%s%s>", | 225 | s2 = xs_fmt("<%s%s%s%s>", |
| 226 | v[1] == '/' ? "/" : "", tag, xs_list_len(el) ? " " : "", s3); | 226 | v[1] == '/' ? "/" : "", tag, xs_list_len(el) ? " " : "", s3); |
| 227 | } | ||
| 228 | else { | ||
| 229 | /* bad tag: escape it */ | ||
| 230 | s2 = xs_replace(v, "<", "<"); | ||
| 231 | } | ||
| 232 | 227 | ||
| 233 | s = xs_str_cat(s, s2); | 228 | s = xs_str_cat(s, s2); |
| 229 | } | ||
| 234 | } | 230 | } |
| 235 | else { | 231 | else { |
| 236 | /* non-tag */ | 232 | /* non-tag */ |