summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-19 21:59:09 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-19 21:59:09 -0800
commita1d74c440b79d13047091b6c10cc0188f758d3ff (patch)
tree8538cb4e7f020376123166d51158b4991b46f08d
parent555dd2da77914d6120b55b64908c59053d1596ec (diff)
Fixed bug in html renderer for custom nodes.
-rw-r--r--src/html.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/html.c b/src/html.c
index 4428fa4..8daf574 100644
--- a/src/html.c
+++ b/src/html.c
@@ -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: