summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/node.c b/src/node.c
index f67d07e..1e1f0e0 100644
--- a/src/node.c
+++ b/src/node.c
@@ -125,8 +125,8 @@ static void S_free_nodes(cmark_node *e) {
break;
case CMARK_NODE_CUSTOM_BLOCK:
case CMARK_NODE_CUSTOM_INLINE:
- cmark_chunk_free(NODE_MEM(e), &e->as.custom.on_enter);
- cmark_chunk_free(NODE_MEM(e), &e->as.custom.on_exit);
+ NODE_MEM(e)->free(e->as.custom.on_enter);
+ NODE_MEM(e)->free(e->as.custom.on_exit);
break;
default:
break;
@@ -571,7 +571,7 @@ const char *cmark_node_get_on_enter(cmark_node *node) {
switch (node->type) {
case CMARK_NODE_CUSTOM_INLINE:
case CMARK_NODE_CUSTOM_BLOCK:
- return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.custom.on_enter);
+ return node->as.custom.on_enter ? (char *)node->as.custom.on_enter : "";
default:
break;
}
@@ -587,7 +587,7 @@ int cmark_node_set_on_enter(cmark_node *node, const char *on_enter) {
switch (node->type) {
case CMARK_NODE_CUSTOM_INLINE:
case CMARK_NODE_CUSTOM_BLOCK:
- cmark_chunk_set_cstr(NODE_MEM(node), &node->as.custom.on_enter, on_enter);
+ cmark_set_cstr(NODE_MEM(node), &node->as.custom.on_enter, on_enter);
return 1;
default:
break;
@@ -604,7 +604,7 @@ const char *cmark_node_get_on_exit(cmark_node *node) {
switch (node->type) {
case CMARK_NODE_CUSTOM_INLINE:
case CMARK_NODE_CUSTOM_BLOCK:
- return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.custom.on_exit);
+ return node->as.custom.on_exit ? (char *)node->as.custom.on_exit : "";
default:
break;
}
@@ -620,7 +620,7 @@ int cmark_node_set_on_exit(cmark_node *node, const char *on_exit) {
switch (node->type) {
case CMARK_NODE_CUSTOM_INLINE:
case CMARK_NODE_CUSTOM_BLOCK:
- cmark_chunk_set_cstr(NODE_MEM(node), &node->as.custom.on_exit, on_exit);
+ cmark_set_cstr(NODE_MEM(node), &node->as.custom.on_exit, on_exit);
return 1;
default:
break;