summaryrefslogtreecommitdiff
path: root/src/cmark.c
blob: 35765b17a6efa2126bfe78cafbaafb365f6b83a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include "node.h"
#include "houdini.h"
#include "cmark.h"
#include "buffer.h"

const int cmark_version = CMARK_VERSION;
const char cmark_version_string[] = CMARK_VERSION_STRING;

char *cmark_markdown_to_html(const char *text, size_t len, int options)
{
	cmark_node *doc;
	char *result;

	doc = cmark_parse_document(text, len, options);

	result = cmark_render_html(doc, options);
	cmark_node_free(doc);

	return result;
}