Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (22 sloc) 607 Bytes
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <markdown_lib.h>
MODULE = Text::Markdown::PegMarkdown PACKAGE = Text::Markdown::PegMarkdown PREFIX = TextMarkdown_
PROTOTYPES: DISABLE
SV *
TextMarkdown__markdown(text)
char *text;
PREINIT:
SV* r = &PL_sv_undef;
char *out = NULL;
int extensions = 0;
int output_format = HTML_FORMAT;
CODE:
out = markdown_to_string(text, extensions, output_format);
r = newSVpvn(out, strlen(out));
Safefree(out);
RETVAL = r;
OUTPUT:
RETVAL