Commit aa654230915db7439eb22ae8b0d6c58f4409e17d

Martin Mitas 2021-03-22T14:00:35

md_enter_child_containers: Propagate list mark character properly. Fixes #153, #154.

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d09292..649cf1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,12 @@ Fixes:
    command line options is used, accordingly to the expected output format
    (HTML or XHTML).
 
+ * [#153](https://github.com/mity/md4c/issues/153),
+   [#154](https://github.com/mity/md4c/issues/154):
+   Set `MD_BLOCK_UL_DETAIL::mark` and `MD_BLOCK_OL_DETAIL::mark_delimiter`
+   correctly, even when the blocks are nested at the same line in a complicated
+   ways.
+
 
 ## Version 0.4.7
 
diff --git a/src/md4c.c b/src/md4c.c
index dc8a936..9e720be 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -5525,7 +5525,7 @@ md_push_container(MD_CTX* ctx, const MD_CONTAINER* container)
 }
 
 static int
-md_enter_child_containers(MD_CTX* ctx, int n_children, unsigned data)
+md_enter_child_containers(MD_CTX* ctx, int n_children)
 {
     int i;
     int ret = 0;
@@ -5550,7 +5550,7 @@ md_enter_child_containers(MD_CTX* ctx, int n_children, unsigned data)
 
                 MD_CHECK(md_push_container_bytes(ctx,
                                 (is_ordered_list ? MD_BLOCK_OL : MD_BLOCK_UL),
-                                c->start, data, MD_BLOCK_CONTAINER_OPENER));
+                                c->start, c->ch, MD_BLOCK_CONTAINER_OPENER));
                 MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
                                 c->task_mark_off,
                                 (c->is_task ? CH(c->task_mark_off) : 0),
@@ -6162,7 +6162,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
     }
 
     if(n_children > 0)
-        MD_CHECK(md_enter_child_containers(ctx, n_children, line->data));
+        MD_CHECK(md_enter_child_containers(ctx, n_children));
 
 abort:
     return ret;