From b93d0b3a479bfc05dfbba0ad84172302df7f48cc Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 19 Nov 2014 16:28:48 +0100 Subject: Accessors for string content of code and HTML blocks --- src/node.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/node.c b/src/node.c index 9119c63..1b767ae 100644 --- a/src/node.c +++ b/src/node.c @@ -98,6 +98,11 @@ S_strdup(const char *str) { const char* cmark_node_get_string_content(cmark_node *node) { switch (node->type) { + case NODE_INDENTED_CODE: + case NODE_FENCED_CODE: + case NODE_HTML: + return cmark_strbuf_cstr(&node->string_content); + case NODE_STRING: case NODE_INLINE_HTML: case NODE_INLINE_CODE: @@ -112,6 +117,11 @@ cmark_node_get_string_content(cmark_node *node) { int cmark_node_set_string_content(cmark_node *node, const char *content) { switch (node->type) { + case NODE_INDENTED_CODE: + case NODE_FENCED_CODE: + case NODE_HTML: + cmark_strbuf_sets(&node->string_content, content); + case NODE_STRING: case NODE_INLINE_HTML: case NODE_INLINE_CODE: -- cgit v1.2.3