diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-12-19 21:59:09 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-12-19 21:59:09 -0800 |
commit | a1d74c440b79d13047091b6c10cc0188f758d3ff (patch) | |
tree | 8538cb4e7f020376123166d51158b4991b46f08d /src/html.c | |
parent | 555dd2da77914d6120b55b64908c59053d1596ec (diff) |
Fixed bug in html renderer for custom nodes.
Diffstat (limited to 'src/html.c')
-rw-r--r-- | src/html.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -178,10 +178,13 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, case CMARK_NODE_CUSTOM_BLOCK: cr(html); - cmark_strbuf_put( - html, (const unsigned char *)(entering ? cmark_node_get_on_enter(node) - : cmark_node_get_on_exit(node)), - node->as.literal.len); + if (entering) { + cmark_strbuf_put(html, node->as.custom.on_enter.data, + node->as.custom.on_enter.len); + } else { + cmark_strbuf_put(html, node->as.custom.on_exit.data, + node->as.custom.on_exit.len); + } cr(html); break; @@ -243,10 +246,13 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, break; case CMARK_NODE_CUSTOM_INLINE: - cmark_strbuf_put( - html, (const unsigned char *)(entering ? cmark_node_get_on_enter(node) - : cmark_node_get_on_exit(node)), - node->as.literal.len); + if (entering) { + cmark_strbuf_put(html, node->as.custom.on_enter.data, + node->as.custom.on_enter.len); + } else { + cmark_strbuf_put(html, node->as.custom.on_exit.data, + node->as.custom.on_exit.len); + } break; case CMARK_NODE_STRONG: |