From 5a26ca5cf9481289ad77d6049b55c48feea7cc38 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 16 Nov 2014 10:45:50 -0800 Subject: cmark_render_html now just returns a regular C string. This way, we don't have to expose buffer.h; it is just used internally. --- src/html/html.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/html') diff --git a/src/html/html.c b/src/html/html.c index cd02f83..faa570b 100644 --- a/src/html/html.c +++ b/src/html/html.c @@ -5,6 +5,7 @@ #include #include "cmark.h" +#include "buffer.h" #include "ast.h" #include "debug.h" #include "html/houdini.h" @@ -373,7 +374,12 @@ static void blocks_to_html(strbuf *html, node_block *b) free_render_stack(rstack); } -extern void cmark_render_html(strbuf *html, node_block *root) +unsigned char *cmark_render_html(node_block *root) { - blocks_to_html(html, root); + unsigned char *result; + strbuf html = GH_BUF_INIT; + blocks_to_html(&html, root); + result = strbuf_detach(&html); + strbuf_free(&html); + return result; } -- cgit v1.2.3