summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-19 16:28:48 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-19 16:28:48 +0100
commitb93d0b3a479bfc05dfbba0ad84172302df7f48cc (patch)
tree3f046a0094e953e2b86a4a563935797aa530b9c5 /src/node.c
parent18169a8174cd0c49d64d95a3b9509a66d359da27 (diff)
Accessors for string content of code and HTML blocks
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c10
1 files changed, 10 insertions, 0 deletions
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: