diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-16 22:21:55 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-16 22:22:56 -0700 |
commit | 04726a7089e44e7ff4e6c552524841579a1053da (patch) | |
tree | bc1657e17edb1d264a0cfe8adfe3c378b7baa8ae /api_test/main.c | |
parent | fb7af2f0d6ca845b33364c6ce9a704a458e31ff9 (diff) |
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.
Diffstat (limited to 'api_test/main.c')
-rw-r--r-- | api_test/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
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, "))))</p>\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); |