summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 4317dd4..bb9cacc 100644
--- a/src/node.c
+++ b/src/node.c
@@ -11,6 +11,25 @@ cmark_node*
cmark_node_new(cmark_node_type type) {
cmark_node *node = (cmark_node *)calloc(1, sizeof(*node));
node->type = type;
+
+ switch (node->type) {
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
+ node->as.header.level = 1;
+ break;
+
+ case CMARK_NODE_LIST: {
+ cmark_list *list = &node->as.list;
+ list->list_type = CMARK_BULLET_LIST;
+ list->start = 1;
+ list->tight = false;
+ break;
+ }
+
+ default:
+ break;
+ }
+
return node;
}