cmark

My personal build of CMark ✏️

Commit
0b1886ca44e0b562f9022ad95568acd6f9b4e1d2
Parent
58b37aec94823aae047597593604c7f29d9e48fa
Author
John MacFarlane <jgm@berkeley.edu>
Date

Fixed cmark_node_get_list_start to return 0 for bullet lists...

as documented!

Closes #202.

Diffstat

3 files changed, 4 insertions, 4 deletions

Status File Name N° Changes Insertions Deletions
Modified api_test/main.c 4 2 2
Modified src/blocks.c 2 1 1
Modified src/node.c 2 1 1
diff --git a/api_test/main.c b/api_test/main.c
@@ -59,8 +59,8 @@ static void constructor(test_batch_runner *runner) {
              "default is list type is bullet");
       INT_EQ(runner, cmark_node_get_list_delim(node), CMARK_NO_DELIM,
              "default is list delim is NO_DELIM");
-      INT_EQ(runner, cmark_node_get_list_start(node), 1,
-             "default is list start is 1");
+      INT_EQ(runner, cmark_node_get_list_start(node), 0,
+             "default is list start is 0");
       INT_EQ(runner, cmark_node_get_list_tight(node), 0,
              "default is list is loose");
       break;
diff --git a/src/blocks.c b/src/blocks.c
@@ -414,7 +414,7 @@ static bufsize_t parse_list_marker(cmark_mem *mem, cmark_chunk *input,
     data->marker_offset = 0; // will be adjusted later
     data->list_type = CMARK_BULLET_LIST;
     data->bullet_char = c;
-    data->start = 1;
+    data->start = 0;
     data->delimiter = CMARK_NO_DELIM;
     data->tight = false;
   } else if (cmark_isdigit(c)) {
diff --git a/src/node.c b/src/node.c
@@ -85,7 +85,7 @@ cmark_node *cmark_node_new_with_mem(cmark_node_type type, cmark_mem *mem) {
   case CMARK_NODE_LIST: {
     cmark_list *list = &node->as.list;
     list->list_type = CMARK_BULLET_LIST;
-    list->start = 1;
+    list->start = 0;
     list->tight = false;
     break;
   }