diff options
-rw-r--r-- | src/cmark.h | 6 | ||||
-rw-r--r-- | src/node.c | 21 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h index 5305dfb..d9daccd 100644 --- a/src/cmark.h +++ b/src/cmark.h @@ -121,6 +121,12 @@ CMARK_EXPORT int cmark_node_set_list_tight(cmark_node *node, int tight); CMARK_EXPORT const char* +cmark_node_get_fence_info(cmark_node *node); + +CMARK_EXPORT int +cmark_node_set_fence_info(cmark_node *node, const char *info); + +CMARK_EXPORT const char* cmark_node_get_url(cmark_node *node); CMARK_EXPORT int @@ -227,6 +227,27 @@ cmark_node_set_list_tight(cmark_node *node, int tight) { } const char* +cmark_node_get_fence_info(cmark_node *node) { + if (node->type == NODE_FENCED_CODE) { + return cmark_strbuf_cstr(&node->as.code.info); + } + else { + return NULL; + } +} + +int +cmark_node_set_fence_info(cmark_node *node, const char *info) { + if (node->type == NODE_FENCED_CODE) { + cmark_strbuf_sets(&node->as.code.info, info); + return 1; + } + else { + return 0; + } +} + +const char* cmark_node_get_url(cmark_node *node) { switch (node->type) { case NODE_LINK: |