Example #1
0
def test_parser_interface():
    text = u"Hello, **world**!"
    parser = cmark.parser_new()
    cmark.parser_feed(parser, text)
    root = cmark.parser_finish(parser)
    result = cmark.render_html(root)
    cmark.parser_free(parser)
    assert result == '<p>Hello, <strong>world</strong>!</p>\n'
Example #2
0
def test_render_html():
    text = u"Hello, **world**!"
    root = cmark.parse_document(text)
    result = cmark.render_html(root)
    assert result == '<p>Hello, <strong>world</strong>!</p>\n'