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 147debf..fa538bc 100644
--- a/src/node.c
+++ b/src/node.c
@@ -109,8 +109,8 @@ static void S_free_nodes(cmark_node *e) {
cmark_strbuf_free(&e->content);
switch (e->type) {
case CMARK_NODE_CODE_BLOCK:
- cmark_chunk_free(NODE_MEM(e), &e->as.code.info);
- cmark_chunk_free(NODE_MEM(e), &e->as.code.literal);
+ NODE_MEM(e)->free(e->as.code.info);
+ NODE_MEM(e)->free(e->as.code.literal);
break;
case CMARK_NODE_TEXT:
case CMARK_NODE_HTML_INLINE:
@@ -298,7 +298,7 @@ const char *cmark_node_get_literal(cmark_node *node) {
return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.literal);
case CMARK_NODE_CODE_BLOCK:
- return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.code.literal);
+ return (char *)node->as.code.literal;
default:
break;
@@ -321,7 +321,7 @@ int cmark_node_set_literal(cmark_node *node, const char *content) {
return 1;
case CMARK_NODE_CODE_BLOCK:
- cmark_chunk_set_cstr(NODE_MEM(node), &node->as.code.literal, content);
+ cmark_set_cstr(NODE_MEM(node), &node->as.code.literal, content);
return 1;
default:
@@ -478,7 +478,7 @@ const char *cmark_node_get_fence_info(cmark_node *node) {
}
if (node->type == CMARK_NODE_CODE_BLOCK) {
- return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.code.info);
+ return node->as.code.info ? (char *)node->as.code.info : "";
} else {
return NULL;
}
@@ -490,7 +490,7 @@ int cmark_node_set_fence_info(cmark_node *node, const char *info) {
}
if (node->type == CMARK_NODE_CODE_BLOCK) {
- cmark_chunk_set_cstr(NODE_MEM(node), &node->as.code.info, info);
+ cmark_set_cstr(NODE_MEM(node), &node->as.code.info, info);
return 1;
} else {
return 0;