From 37554bbb7901b7116e1a5006f331968444141b76 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 14 Dec 2014 13:49:53 -0800 Subject: Use as.literal instead of string_content for HTML and code blocks. This is for consistency with the other types of nodes that have literal strings as contents. --- src/node.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index 276ed46..d74b1fc 100644 --- a/src/node.c +++ b/src/node.c @@ -42,10 +42,12 @@ void S_free_nodes(cmark_node *e) switch (e->type){ case NODE_CODE_BLOCK: strbuf_free(&e->as.code.info); + chunk_free(&e->as.literal); break; case NODE_TEXT: case NODE_INLINE_HTML: case NODE_CODE: + case NODE_HTML: chunk_free(&e->as.literal); break; case NODE_LINK: @@ -183,8 +185,6 @@ cmark_node_get_string_content(cmark_node *node) { switch (node->type) { case NODE_CODE_BLOCK: case NODE_HTML: - return strbuf_cstr(&node->string_content); - case NODE_TEXT: case NODE_INLINE_HTML: case NODE_CODE: @@ -206,9 +206,6 @@ cmark_node_set_string_content(cmark_node *node, const char *content) { switch (node->type) { case NODE_CODE_BLOCK: case NODE_HTML: - strbuf_sets(&node->string_content, content); - return 1; - case NODE_TEXT: case NODE_INLINE_HTML: case NODE_CODE: -- cgit v1.2.3