diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-09-28 00:13:17 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-09-28 00:13:42 +0200 |
| commit | a13b91d64c96670caff1ea9830b7e4a90ad81eaa (patch) | |
| tree | e0815ba027359708ddaf69156e27507240a2267c | |
| parent | 94ddbec88e57fe742f219a30145650165887f22c (diff) | |
html.c: Replace \n with <br> on html_encode
This replacement can come in handy for library users dealing with
multi-line user-generated content.
| -rw-r--r-- | html.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -47,7 +47,8 @@ char *html_encode(const char *s) {.c = '<', .str = "<"}, {.c = '&', .str = "&"}, {.c = '\"', .str = """}, - {.c = '\'', .str = "'"} + {.c = '\'', .str = "'"}, + {.c = '\n', .str = "<br>"} }; char buf[sizeof "a"] = {0}; |
