diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-19 17:02:04 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-19 17:02:40 +0100 |
commit | 14588ca3cd25982bdd34e5fc20e69c611e1c8817 (patch) | |
tree | a4f89c4b7e21bf76e477ce89a24c1253a5219ce4 /src/node.c | |
parent | 285879585db2f284a1ce0896c4775be8a260d6db (diff) |
Accessors for fence info
Only fence info should be relevant for rendering. Accessors for other
fenced code data could be added for completeness but they don't seem
very useful.
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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: |