summaryrefslogtreecommitdiff
path: root/libcmark-gfm/tests/basic/driver.c
blob: 1cd06c2e7da807d599f3dc1910b56e9a36b31e79 (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
25
26
27
/*
 * file      : tests/basic/driver.c
 * license   : FreeBSD License; see accompanying COPYING file
 */

#include <stdio.h>
#include <string.h>
#include <assert.h>

#include <cmark-gfm.h>
#include <cmark-gfm-extension_api.h>

int
main (int argc, const char* argv[])
{
  assert (argc == 2);

  const char* from = argv[1];

  char* to = cmark_markdown_to_html (from,
                                     strlen (from),
                                     CMARK_OPT_DEFAULT |
                                     CMARK_OPT_VALIDATE_UTF8);
  printf ("%s", to);
  cmark_get_default_mem_allocator ()->free (to);
  return 0;
}