aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-02-24 23:12:40 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-02-24 23:12:40 +0100
commit699f4b4032431fbd7f4fbf13fe9e2b085225b215 (patch)
tree3a8b605f56a4c05384abd21d6e58e7017f55ed7e /tests
parent2ae2d648ab0bd5340ca1342c97d704b2d4ce948c (diff)
downloadblogc-699f4b4032431fbd7f4fbf13fe9e2b085225b215.tar.gz
blogc-699f4b4032431fbd7f4fbf13fe9e2b085225b215.tar.bz2
blogc-699f4b4032431fbd7f4fbf13fe9e2b085225b215.zip
blogc: content: do not escape inline code
this is more compatible with markdown spec[1] [1] https://daringfireball.net/projects/markdown/syntax#code
Diffstat (limited to 'tests')
-rw-r--r--tests/blogc/check_content_parser.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/blogc/check_content_parser.c b/tests/blogc/check_content_parser.c
index cd8ba57..de15bac 100644
--- a/tests/blogc/check_content_parser.c
+++ b/tests/blogc/check_content_parser.c
@@ -1951,11 +1951,15 @@ test_content_parse_inline_code(void **state)
free(html);
html = blogc_content_parse_inline("`bo\\`\\`la`\n");
assert_non_null(html);
- assert_string_equal(html, "<code>bo``la</code>\n");
+ assert_string_equal(html, "<code>bo\\`\\`la</code>\n");
free(html);
html = blogc_content_parse_inline("``bo\\`\\`la``\n");
assert_non_null(html);
- assert_string_equal(html, "<code>bo``la</code>\n");
+ assert_string_equal(html, "<code>bo\\`\\`la</code>\n");
+ free(html);
+ html = blogc_content_parse_inline("``bo`la``\n");
+ assert_non_null(html);
+ assert_string_equal(html, "<code>bo`la</code>\n");
free(html);
html = blogc_content_parse_inline("``bola\n");
assert_non_null(html);
@@ -2009,7 +2013,11 @@ test_content_parse_inline_link(void **state)
free(html);
html = blogc_content_parse_inline("[``bola(2)[3]**!\\```](http://example.org/)\n");
assert_non_null(html);
- assert_string_equal(html, "<a href=\"http://example.org/\"><code>bola(2)[3]**!`</code></a>\n");
+ assert_string_equal(html, "<a href=\"http://example.org/\"><code>bola(2)[3]**!\\`</code></a>\n");
+ free(html);
+ html = blogc_content_parse_inline("[``bola(2)[3]**!```](http://example.org/)\n");
+ assert_non_null(html);
+ assert_string_equal(html, "<a href=\"http://example.org/\"><code>bola(2)[3]**!</code>`</a>\n");
free(html);
html = blogc_content_parse_inline("test suite!)\n"
"depends on [cmocka](http://cmocka.org/), though.\n");