From 0566fa09cf2369cef3ea6b459f3d4fcf3a27d0fc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 29 Dec 2014 12:20:19 -0800 Subject: Added options parameter to renderers. To keep the API simple and avoid API changes when new options are added, this is just a long integer. Set it by disjoining options that are defined as powers of 2: e.g. `CMARK_HTML_SOURCEPOS | CMARK_HTML_HARDREAKS`. Test options using `&`: `if (options & CMARK_HTML_SOURCEPOS)`. Added `--hardbreaks` and `--sourcepos` command-line options. --- api_test/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'api_test') diff --git a/api_test/main.c b/api_test/main.c index b098c41..fae1d05 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -210,7 +210,7 @@ accessors(test_batch_runner *runner) OK(runner, cmark_node_set_literal(string, "LINK"), "set_literal string"); - char *rendered_html = cmark_render_html(doc); + char *rendered_html = cmark_render_html(doc, CMARK_OPT_DEFAULT); static const char expected_html[] = "

Header

\n" "
    \n" @@ -355,7 +355,7 @@ create_tree(test_batch_runner *runner) OK(runner, cmark_node_append_child(emph, str2), "append3"); INT_EQ(runner, cmark_node_check(doc, NULL), 0, "append3 consistent"); - html = cmark_render_html(doc); + html = cmark_render_html(doc, CMARK_OPT_DEFAULT); STR_EQ(runner, html, "

    Hello, world!

    \n", "render_html"); free(html); @@ -386,7 +386,7 @@ create_tree(test_batch_runner *runner) cmark_node_unlink(emph); - html = cmark_render_html(doc); + html = cmark_render_html(doc, CMARK_OPT_DEFAULT); STR_EQ(runner, html, "

    Hello, !

    \n", "render_html after shuffling"); free(html); @@ -501,18 +501,18 @@ render_html(test_batch_runner *runner) cmark_node *doc = cmark_parse_document(markdown, sizeof(markdown) - 1); cmark_node *paragraph = cmark_node_first_child(doc); - html = cmark_render_html(paragraph); + html = cmark_render_html(paragraph, CMARK_OPT_DEFAULT); STR_EQ(runner, html, "

    foo bar

    \n", "render single paragraph"); free(html); cmark_node *string = cmark_node_first_child(paragraph); - html = cmark_render_html(string); + html = cmark_render_html(string, CMARK_OPT_DEFAULT); STR_EQ(runner, html, "foo ", "render single inline"); free(html); cmark_node *emph = cmark_node_next(string); - html = cmark_render_html(emph); + html = cmark_render_html(emph, CMARK_OPT_DEFAULT); STR_EQ(runner, html, "bar", "render inline with children"); free(html); -- cgit v1.2.3