diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2014-11-25 15:54:27 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2014-11-25 15:54:27 -0800 |
commit | 7bc7581b22fbb2f77529a5ac9bca57ed1916bd32 (patch) | |
tree | 023a41962fbcd7142be5d5a31acc1a849675c3e6 /src/print.c | |
parent | 8ee6f28d2fe0d990da8bdd88579dcd8cc488d01b (diff) |
Replaced cmark_debug_print with cmark_render_ast.
This returns a string.
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c index 9f1f233..d2dfe8c 100644 --- a/src/print.c +++ b/src/print.c @@ -158,9 +158,12 @@ static void render_nodes(strbuf* buffer, cmark_node* node, int indent) } } -void cmark_debug_print(cmark_node *root) +char *cmark_render_ast(cmark_node *root) { + char* result; strbuf buffer = GH_BUF_INIT; render_nodes(&buffer, root, -2); - printf("%s", buffer.ptr); + result = (char *)strbuf_detach(&buffer); + strbuf_free(&buffer); + return result; } |