From a13b91d64c96670caff1ea9830b7e4a90ad81eaa Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 28 Sep 2025 00:13:17 +0200 Subject: html.c: Replace \n with
on html_encode This replacement can come in handy for library users dealing with multi-line user-generated content. --- html.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'html.c') diff --git a/html.c b/html.c index 4af536e..f06b336 100644 --- a/html.c +++ b/html.c @@ -47,7 +47,8 @@ char *html_encode(const char *s) {.c = '<', .str = "<"}, {.c = '&', .str = "&"}, {.c = '\"', .str = """}, - {.c = '\'', .str = "'"} + {.c = '\'', .str = "'"}, + {.c = '\n', .str = "
"} }; char buf[sizeof "a"] = {0}; -- cgit v1.2.3