summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 1b767ae..56f3937 100644
--- a/src/node.c
+++ b/src/node.c
@@ -134,6 +134,35 @@ cmark_node_set_string_content(cmark_node *node, const char *content) {
return 0;
}
+int
+cmark_node_get_header_level(cmark_node *node) {
+ switch (node->type) {
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
+ return node->as.header.level;
+
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+int
+cmark_node_set_header_level(cmark_node *node, int level) {
+ switch (node->type) {
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
+ node->as.header.level = level;
+ return 1;
+
+ default:
+ break;
+ }
+
+ return 0;
+}
+
const char*
cmark_node_get_url(cmark_node *node) {
switch (node->type) {