diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2014-11-16 10:45:50 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2014-11-16 10:45:50 -0800 |
commit | 5a26ca5cf9481289ad77d6049b55c48feea7cc38 (patch) | |
tree | 561595c5de9009425a168a39d9f4f3060b82183d /src/html | |
parent | b7f6e3f775705029df262aa313a0cd17ee3073cb (diff) |
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.
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/html.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 <assert.h> #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; } |