summaryrefslogtreecommitdiff
path: root/api_test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-29 12:20:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-29 12:50:58 -0800
commit0566fa09cf2369cef3ea6b459f3d4fcf3a27d0fc (patch)
treeadae2b1e8da52a6edfdb459cba975b257eae2f9a /api_test
parent96c7df6a8480b78ddc2540dd85877487af358ceb (diff)
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.
Diffstat (limited to 'api_test')
-rw-r--r--api_test/main.c12
1 files changed, 6 insertions, 6 deletions
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[] =
"<h3>Header</h3>\n"
"<ol start=\"3\">\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, "<p>Hello, <em>world</em>!</p>\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, "<p>Hello, !</p>\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, "<p>foo <em>bar</em></p>\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, "<em>bar</em>", "render inline with children");
free(html);