From 04726a7089e44e7ff4e6c552524841579a1053da Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 16 Jun 2015 22:21:55 -0700 Subject: Added `CMARK_OPT_VALIDATE_UTF8` option. Also command line option `--validate-utf8`. This option causes cmark to check for valid UTF-8, replacing invalid sequences with the replacement character, U+FFFD. Reinstated api tests for utf8. --- api_test/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api_test/main.c') diff --git a/api_test/main.c b/api_test/main.c index 871b3a5..666af4d 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -658,7 +658,7 @@ test_continuation_byte(test_batch_runner *runner, const char *utf8) strcat(expected, "))))

\n"); char *html = cmark_markdown_to_html(buf, strlen(buf), - CMARK_OPT_DEFAULT); + CMARK_OPT_VALIDATE_UTF8); STR_EQ(runner, html, expected, "invalid utf8 continuation byte %d/%d", pos, len); free(html); @@ -718,7 +718,7 @@ test_md_to_html(test_batch_runner *runner, const char *markdown, const char *expected_html, const char *msg) { char *html = cmark_markdown_to_html(markdown, strlen(markdown), - CMARK_OPT_DEFAULT); + CMARK_OPT_VALIDATE_UTF8); STR_EQ(runner, html, expected_html, msg); free(html); } @@ -737,7 +737,7 @@ int main() { hierarchy(runner); parser(runner); render_html(runner); - // utf8(runner); + utf8(runner); line_endings(runner); numeric_entities(runner); test_cplusplus(runner); -- cgit v1.2.3