diff options
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -260,7 +260,7 @@ xs_str *sanitize(const char *content) } -xs_str *encode_html(const char *str) +xs_str *encode_html_strict(const char *str) /* escapes html characters */ { xs_str *encoded = xs_replace(str, "&", "&"); @@ -269,6 +269,15 @@ xs_str *encode_html(const char *str) encoded = xs_replace_i(encoded, "\"", """); encoded = xs_replace_i(encoded, "'", "'"); + return encoded; +} + + +xs_str *encode_html(const char *str) +/* escapes html characters */ +{ + xs_str *encoded = encode_html_strict(str); + /* Restore only <br>. Probably safe. Let's hope nothing goes wrong with this. */ encoded = xs_replace_i(encoded, "<br>", "<br>"); |