From cb132cf02e57f57f4507fbc0126481629d83f209 Mon Sep 17 00:00:00 2001
From: "Rafael G. Martins"
%s", line_ending);
b_slist_free_full(lines, free);
diff --git a/src/content-parser.h b/src/content-parser.h
index 5802594..6617bb4 100644
--- a/src/content-parser.h
+++ b/src/content-parser.h
@@ -13,6 +13,7 @@
#include ");
for (b_slist_t *l = lines; l != NULL; l = l->next) {
+ char *tmp_line = blogc_htmlentities(l->data);
if (l->next == NULL)
- b_string_append_printf(rv, "%s", l->data);
+ b_string_append_printf(rv, "%s", tmp_line);
else
- b_string_append_printf(rv, "%s%s", l->data,
+ b_string_append_printf(rv, "%s%s", tmp_line,
line_ending);
+ free(tmp_line);
}
b_string_append_printf(rv, "
asd
\n"
"\n"
- "bola\n"
+ "<asd>bola</asd>\n"
" asd\n"
"qwewer
\n"
"
\n"
@@ -165,7 +176,7 @@ test_content_parse_crlf(void **state)
"> \r\n"
"> asd\r\n"
"\r\n"
- " bola\r\n"
+ " bola \r\n"
" asd\r\n"
" qwewer\r\n"
"\r\n"
@@ -200,7 +211,7 @@ test_content_parse_crlf(void **state)
"buga\r\n"
"asd
\r\n"
"\r\n"
- "bola\r\n"
+ "<asd>bola</asd>\r\n"
" asd\r\n"
"qwewer
\r\n"
"
\r\n"
@@ -1663,6 +1674,7 @@ main(void)
{
const UnitTest tests[] = {
unit_test(test_slugify),
+ unit_test(test_htmlentities),
unit_test(test_is_ordered_list_item),
unit_test(test_content_parse),
unit_test(test_content_parse_crlf),
--
cgit v1.2.3-18-g5258