in plugins/gfm.py [0:0]
def render(self, text):
"Use cmark-gfm to render the Markdown into an HTML fragment."
parser = F_cmark_parser_new(OPTS)
assert parser, 'Failed to initialise parser'
for name in EXTENSIONS:
ext = F_cmark_find_syntax_extension(name.encode('utf-8'))
assert ext, 'Failed to find UTF-8 extension'
rv = F_cmark_parser_attach_syntax_extension(parser, ext)
assert rv, 'Failed to attach the UTF-8 extension'
exts = F_cmark_parser_get_syntax_extensions(parser)
F_cmark_parser_feed(parser, text, len(text))
doc = F_cmark_parser_finish(parser)
assert doc, 'Did not expect rendered output to be empty'
output = F_cmark_render_html(doc, OPTS, exts)
F_cmark_parser_free(parser)
F_cmark_node_free(doc)
return output