Beispiel #1
0
unsigned char *cmark_markdown_to_html(unsigned char *text, int len)
{
	node_block *blocks;
	unsigned char *result;

	blocks = cmark_parse_document(text, len);

	result = cmark_render_html(blocks);
	cmark_free_blocks(blocks);

	return result;
}
Beispiel #2
0
unsigned char *cmark_markdown_to_html(unsigned char *text, int len)
{
	node_block *blocks;
	strbuf htmlbuf = GH_BUF_INIT;
	unsigned char *result;

	blocks = cmark_parse_document(text, len);

	cmark_render_html(&htmlbuf, blocks);
	cmark_free_blocks(blocks);

	result = strbuf_detach(&htmlbuf);
	strbuf_free(&htmlbuf);

	return result;
}