Repository: jackdewinter/pymarkdown

Issue:
Markdown: Regenerated markdown has extra line
Found by https://github.com/jackdewinter/pymarkdown/issues/261 :

```
-=-=-
Expected
-=-=-
-->   >    >    >\n             > list<--
-=-=-
Actual
-=-=-
-->   >    >    >\n\n             > list<--
-=-=-
```

Tests:
Done - test_nested_three_block_max_block_max_block_max_empty
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq1
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq2
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq3
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq4
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq5
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq6
Done - test_nested_three_block_max_block_max_block_max_empty_no_bq7
Done - test_nested_three_block_max_ordered_max_block_max_empty_no_bq1
Done - test_nested_three_block_max_ordered_max_block_max_empty_no_bq3
Done - test_nested_three_block_max_unordered_max_block_max_empty_no_bq1
Done - test_nested_three_block_max_unordered_max_block_max_empty_no_bq3
Done - test_nested_three_ordered_max_block_max_block_max_empty
Done - test_nested_three_ordered_max_block_max_block_max_empty_no_bq1
Done - test_nested_three_ordered_max_block_max_block_max_empty_no_bq3
Done - test_nested_three_ordered_max_ordered_max_block_max_empty
Done - test_nested_three_ordered_max_ordered_max_block_max_empty_no_bq1
Done - test_nested_three_ordered_max_unordered_max_block_max_empty
Done - test_nested_three_ordered_max_unordered_max_block_max_empty_no_bq1
Done - test_nested_three_unordered_max_block_max_block_max_empty
Done - test_nested_three_unordered_max_block_max_block_max_empty_no_bq1
Done - test_nested_three_unordered_max_block_max_block_max_empty_no_bq3
Done - test_nested_three_unordered_max_ordered_max_block_max_empty
Done - test_nested_three_unordered_max_unordered_max_block_max_empty
Done - test_nested_three_unordered_max_unordered_max_block_max_empty_no_bq1
Done - test_nested_three_unordered_max_ordered_max_block_max_empty_no_bq1

Discussion:

Patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4a3a1d2a..f0cbf10d 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -26,9 +26,8 @@ jobs:
         with:
           python-version: 3.8
       - name: Install PipEnv
-        uses: dschep/install-pipenv-action@v1
-        with:
-          version: 2021.5.29
+        run: |
+          pip install pipenv==2022.1.8
       - name: Sync With Repository
         run: pipenv sync
       - name: Execute Tests
@@ -61,7 +60,8 @@ jobs:
         with:
           python-version: 3.8
       - name: Install PipEnv
-        uses: dschep/install-pipenv-action@v1
+        run: |
+          pip install pipenv==2022.1.8
       - name: Sync With Repository
         run: pipenv sync
       - name: Execute Flake8
diff --git a/changelog.md b/changelog.md
index 9d89c1ba..93f4b5cd 100644
--- a/changelog.md
+++ b/changelog.md
@@ -41,6 +41,8 @@
   - parser: indent being processed twice
 - [Fixed - Issue 252](https://github.com/jackdewinter/pymarkdown/issues/252)
   - parser: in rare cases, was adding leading spaces to both list and paragraph within
+- [Fixed - Issue 263](https://github.com/jackdewinter/pymarkdown/issues/263)
+  - parser: with empty list items, was creating 2 blank line tokens, plus extra list indent
 
 ## Version 0.9.4 - Date: 2022-01-04
 
diff --git a/publish/coverage.json b/publish/coverage.json
index d1a10eae..e8f5a03d 100644
--- a/publish/coverage.json
+++ b/publish/coverage.json
@@ -6,8 +6,8 @@
         "totalCovered": 3016
     },
     "lineLevel": {
-        "totalMeasured": 10534,
-        "totalCovered": 10534
+        "totalMeasured": 10526,
+        "totalCovered": 10526
     }
 }
 
diff --git a/pymarkdown/container_block_processor.py b/pymarkdown/container_block_processor.py
index 4a2d3341..a5d5153c 100644
--- a/pymarkdown/container_block_processor.py
+++ b/pymarkdown/container_block_processor.py
@@ -139,6 +139,7 @@ class ContainerBlockProcessor:
             and is_not_in_root_list
         ):
             POGGER.debug("indent")
+            did_blank, force_leaf_token_parse = False, False
             (
                 can_continue,
                 line_to_parse,
@@ -176,6 +177,7 @@ class ContainerBlockProcessor:
                 block_quote_data,
                 indent_already_processed,
                 force_leaf_token_parse,
+                did_blank,
             ) = ContainerBlockProcessor.__handle_non_leaf_block(
                 parser_state,
                 position_marker,
@@ -197,8 +199,10 @@ class ContainerBlockProcessor:
         # POGGER.debug("start_index>>$", start_index)
 
         # POGGER.debug("indent_already_processed=$", indent_already_processed)
+        # POGGER.debug("force_leaf_token_parse=$", force_leaf_token_parse)
+        # POGGER.debug("did_blank=$", did_blank)
         if (
-            can_continue and not skip_containers_before_leaf_blocks
+            can_continue and not skip_containers_before_leaf_blocks and not did_blank
         ) or force_leaf_token_parse:
             # POGGER.debug(">>text_removed_by_container>>:$:", text_removed_by_container)
             # POGGER.debug(
@@ -233,7 +237,7 @@ class ContainerBlockProcessor:
             line_to_parse,
             block_quote_data.current_count,
             requeue_line_info,
-            False,
+            did_blank,
         )
         # pylint: enable=too-many-locals
         # pylint: enable=too-many-arguments
@@ -262,8 +266,9 @@ class ContainerBlockProcessor:
             removed_chars_at_start,
             last_block_quote_index,
             last_list_start_index,
+            did_blank,
             requeue_line_info,
-        ) = (False, None, None, None, None, None, None, None, None)
+        ) = (False, None, None, None, None, None, None, None, False, None)
 
         if (
             parser_state.token_stack
@@ -287,11 +292,11 @@ class ContainerBlockProcessor:
             extracted_whitespace,
             is_para_continue,
         )
-        POGGER.debug(
-            "skip_containers_before_leaf_blocks:$:", skip_containers_before_leaf_blocks
-        )
-        POGGER.debug("have_pre_processed_indent:$:", have_pre_processed_indent)
-        POGGER.debug("indent_already_processed=$", indent_already_processed)
+        # POGGER.debug(
+        #     "skip_containers_before_leaf_blocks:$:", skip_containers_before_leaf_blocks
+        # )
+        # POGGER.debug("have_pre_processed_indent:$:", have_pre_processed_indent)
+        # POGGER.debug("indent_already_processed=$", indent_already_processed)
         if have_pre_processed_indent:
             (
                 can_continue,
@@ -340,6 +345,7 @@ class ContainerBlockProcessor:
                 last_list_start_index,
                 used_indent,
                 was_paragraph_continuation,
+                did_blank,
                 requeue_line_info,
             ) = ContainerBlockProcessor.__handle_normal_containers(
                 parser_state,
@@ -374,6 +380,7 @@ class ContainerBlockProcessor:
             block_quote_data,
             indent_already_processed,
             force_leaf_token_parse,
+            did_blank,
         )
 
     # pylint: enable=too-many-arguments, too-many-locals
@@ -943,6 +950,7 @@ class ContainerBlockProcessor:
                 -1,
                 None,
                 False,
+                did_blank,
                 requeue_line_info,
             )
 
@@ -955,6 +963,7 @@ class ContainerBlockProcessor:
             block_quote_data,
             last_list_start_index,
             text_removed_by_container,
+            did_blank,
         ) = ContainerBlockProcessor.__handle_nested_blocks(
             parser_state,
             container_depth,
@@ -1016,6 +1025,7 @@ class ContainerBlockProcessor:
             last_list_start_index,
             used_indent,
             was_paragraph_continuation,
+            did_blank,
             requeue_line_info,
         )
 
@@ -1417,6 +1427,7 @@ class ContainerBlockProcessor:
             block_quote_data,
             last_list_start_index,
             text_removed_by_container,
+            did_process_blank_line,
         )
 
     # pylint: enable=too-many-arguments, too-many-locals
@@ -2416,7 +2427,8 @@ class ContainerBlockProcessor:
         #     POGGER.debug("position_marker[$,$]->:$:", position_marker.index_indent,
         # position_marker.index_number, position_marker.text_to_parse)
 
-        POGGER.debug("parser_state.token_document>$", parser_state.token_document)
+        POGGER.debug("\n\nRECURSING\n")
+        # POGGER.debug("parser_state.token_document>$", parser_state.token_document)
         previous_document_length = len(parser_state.token_document)
         (
             produced_inner_tokens,
@@ -2436,9 +2448,9 @@ class ContainerBlockProcessor:
         )
         assert not requeue_line_info or not requeue_line_info.lines_to_requeue
 
-        POGGER.debug("\ncheck next container_start>recursed")
+        POGGER.debug("\nRECURSED\n\n")
 
-        POGGER.debug("previous_document_length=$", previous_document_length)
+        # POGGER.debug("previous_document_length=$", previous_document_length)
         nested_removed_text = ContainerBlockProcessor.__calculate_nested_removed_text(
             parser_state, previous_document_length
         )
@@ -2449,16 +2461,16 @@ class ContainerBlockProcessor:
         )
         POGGER.debug("check next container_start>line_parse>>$", line_to_parse)
         if current_bq_count_increment:
-            POGGER.debug(
-                "block_quote_data.current_count>$", block_quote_data.current_count
-            )
+            # POGGER.debug(
+            #     "block_quote_data.current_count>$", block_quote_data.current_count
+            # )
             block_quote_data = BlockQuoteData(
                 block_quote_data.current_count + current_bq_count_increment,
                 parser_state.count_of_block_quotes_on_stack(),
             )
-            POGGER.debug(
-                "block_quote_data.current_count>$", block_quote_data.current_count
-            )
+            # POGGER.debug(
+            #     "block_quote_data.current_count>$", block_quote_data.current_count
+            # )
 
         POGGER.debug("produced_inner_tokens=$", produced_inner_tokens)
         was_indent_text_added = (
@@ -2469,10 +2481,10 @@ class ContainerBlockProcessor:
         )
         POGGER.debug("was_indent_text_added=$", was_indent_text_added)
 
-        POGGER.debug("parser_state.token_document>$", parser_state.token_document)
+        # POGGER.debug("parser_state.token_document>$", parser_state.token_document)
         parser_state.token_document.extend(produced_inner_tokens)
         POGGER.debug("parser_state.token_document>$", parser_state.token_document)
-        POGGER.debug("did_process_blank_line>$", did_process_blank_line)
+        # POGGER.debug("did_process_blank_line>$", did_process_blank_line)
 
         return (
             line_to_parse,
diff --git a/pymarkdown/tokenized_markdown.py b/pymarkdown/tokenized_markdown.py
index 5823d8bc..8bea3108 100644
--- a/pymarkdown/tokenized_markdown.py
+++ b/pymarkdown/tokenized_markdown.py
@@ -603,7 +603,6 @@ class TokenizedMarkdown:
         make sure to do it uniformly.
         """
 
-        new_tokens = []
         POGGER.debug("cob->top_element->$", parser_state.token_stack[-1])
         POGGER.debug("cob->was_forced->$", was_forced)
         extra_elements = []
@@ -614,12 +613,13 @@ class TokenizedMarkdown:
                 )
             )
 
-        new_tokens.append(
+        new_tokens = [
             parser_state.token_stack[-1].generate_close_markdown_token_from_stack_token(
                 was_forced=was_forced
-            )
-        )
-        new_tokens.extend(extra_elements)
+            ),
+            *extra_elements,
+        ]
+
         del parser_state.token_stack[-1]
         return new_tokens
 
@@ -685,24 +685,25 @@ class TokenizedMarkdown:
             else:
                 new_tokens = n_tokens
 
-        stack_index = parser_state.find_last_list_block_on_stack()
-        POGGER.debug("stack_index>>$", stack_index)
-        if stack_index > 0:
+        list_stack_index = parser_state.find_last_list_block_on_stack()
+        block_stack_index = parser_state.find_last_block_quote_on_stack()
+        POGGER.debug("list_stack_index>>$", list_stack_index)
+        POGGER.debug("block_stack_index>>$", block_stack_index)
+        if list_stack_index > 0 and list_stack_index > block_stack_index:
             POGGER.debug(
                 "blank>>bq_start>>$",
-                parser_state.token_stack[stack_index],
+                parser_state.token_stack[list_stack_index],
             )
-            assert parser_state.token_stack[stack_index].is_list
             POGGER.debug(
                 "hbl>>last_block_token>>$",
-                parser_state.token_stack[stack_index].matching_markdown_token,
+                parser_state.token_stack[list_stack_index].matching_markdown_token,
             )
             parser_state.token_stack[
-                stack_index
+                list_stack_index
             ].matching_markdown_token.add_leading_spaces("")
             POGGER.debug(
                 "hbl>>last_block_token>>$",
-                parser_state.token_stack[stack_index].matching_markdown_token,
+                parser_state.token_stack[list_stack_index].matching_markdown_token,
             )
 
         POGGER.debug("hbl>>new_tokens>>$", new_tokens)


Test patch:
diff --git a/publish/test-results.json b/publish/test-results.json
index 1ae06e2a..47770cf9 100644
--- a/publish/test-results.json
+++ b/publish/test-results.json
@@ -471,7 +471,7 @@
             "totalTests": 190,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 10,
+            "skippedTests": 2,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -479,7 +479,7 @@
             "totalTests": 101,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 4,
+            "skippedTests": 2,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -487,7 +487,7 @@
             "totalTests": 101,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 4,
+            "skippedTests": 2,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -495,7 +495,7 @@
             "totalTests": 80,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 5,
+            "skippedTests": 3,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -503,7 +503,7 @@
             "totalTests": 32,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 2,
+            "skippedTests": 0,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -511,7 +511,7 @@
             "totalTests": 32,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 2,
+            "skippedTests": 0,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -519,7 +519,7 @@
             "totalTests": 80,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 5,
+            "skippedTests": 3,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -527,7 +527,7 @@
             "totalTests": 32,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 2,
+            "skippedTests": 0,
             "elapsedTimeInMilliseconds": 0
         },
         {
@@ -535,7 +535,7 @@
             "totalTests": 32,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 2,
+            "skippedTests": 0,
             "elapsedTimeInMilliseconds": 0
         },
         {
diff --git a/test/test_markdown_lists.py b/test/test_markdown_lists.py
index 094fd55b..770c9fa0 100644
--- a/test/test_markdown_lists.py
+++ b/test/test_markdown_lists.py
@@ -2177,7 +2177,7 @@ def test_list_items_300x():
   >
 * c"""
     expected_tokens = [
-        "[ulist(1,1):*::2::\n]",
+        "[ulist(1,1):*::2::]",
         "[para(1,3):]",
         "[text(1,3):a:]",
         "[end-para:::True]",
@@ -2218,7 +2218,7 @@ def test_list_items_300a():
   >
 1) c"""
     expected_tokens = [
-        "[ulist(1,1):*::2::\n]",
+        "[ulist(1,1):*::2::]",
         "[para(1,3):]",
         "[text(1,3):a:]",
         "[end-para:::True]",
@@ -2262,7 +2262,7 @@ def test_list_items_300b():
   >
   * c"""
     expected_tokens = [
-        "[ulist(1,1):*::2::\n]",
+        "[ulist(1,1):*::2::]",
         "[para(1,3):]",
         "[text(1,3):a:]",
         "[end-para:::True]",
@@ -2568,7 +2568,7 @@ def test_list_items_301d():
   >     c
 - d"""
     expected_tokens = [
-        "[ulist(1,1):-::2::\n\n]",
+        "[ulist(1,1):-::2::\n]",
         "[para(1,3):]",
         "[text(1,3):a:]",
         "[end-para:::True]",
diff --git a/test/test_markdown_nested_three_block_block.py b/test/test_markdown_nested_three_block_block.py
index 1c67566f..480a9513 100644
--- a/test/test_markdown_nested_three_block_block.py
+++ b/test/test_markdown_nested_three_block_block.py
@@ -5793,7 +5793,6 @@ list</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -5808,7 +5807,6 @@ def test_nested_three_block_max_block_max_block_max_empty():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >\n   >    >    > ]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[para(2,16):]",
         "[text(2,16):list:]",
         "[end-para:::True]",
@@ -5864,7 +5862,6 @@ def test_nested_three_block_max_block_max_block_max_no_bq1():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -5880,7 +5877,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq1():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
@@ -5937,7 +5933,6 @@ def test_nested_three_block_max_block_max_block_max_no_bq2():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq2():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -5953,7 +5948,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq2():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >\n   > ]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::True]",
         "[end-block-quote:::True]",
         "[icode-block(2,10):    :]",
@@ -6010,7 +6004,6 @@ def test_nested_three_block_max_block_max_block_max_no_bq3():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq3():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -6026,7 +6019,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq3():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
@@ -6083,7 +6075,6 @@ list</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq4():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -6099,7 +6090,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq4():
         "[block-quote(1,9)::   >    > \n   >    > ]",
         "[block-quote(1,14)::   >    >    >\n   >    > ]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::True]",
         "[icode-block(2,15):    :]",
         "[text(2,15):list: ]",
@@ -6156,7 +6146,6 @@ def test_nested_three_block_max_block_max_block_max_no_bq5():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq5():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -6172,7 +6161,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq5():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
@@ -6229,7 +6217,6 @@ list</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq6():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -6245,7 +6232,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq6():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >\n   > ]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::True]",
         "[end-block-quote:::True]",
         "[icode-block(2,10):    :]",
@@ -6302,7 +6288,6 @@ list</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_block_max_block_max_empty_no_bq7():
     """
     Verify that a nesting of block quote, block quote, block quote, with
@@ -6318,7 +6303,6 @@ def test_nested_three_block_max_block_max_block_max_empty_no_bq7():
         "[block-quote(1,9)::   >    > ]",
         "[block-quote(1,14)::   >    >    >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
         "[end-block-quote:::False]",
diff --git a/test/test_markdown_nested_three_block_ordered.py b/test/test_markdown_nested_three_block_ordered.py
index df735fc8..7cbcf5ed 100644
--- a/test/test_markdown_nested_three_block_ordered.py
+++ b/test/test_markdown_nested_three_block_ordered.py
@@ -3301,7 +3301,6 @@ def test_nested_three_block_max_ordered_max_block_max_no_bq1():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_ordered_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of block quote, ordered list, block quote, with
@@ -3314,10 +3313,9 @@ def test_nested_three_block_max_ordered_max_block_max_empty_no_bq1():
               > item"""
     expected_tokens = [
         "[block-quote(1,4):   :   > ]",
-        "[olist(1,9):.:1:14:   :]",
+        "[olist(1,9):.:1:14:   ]",
         "[block-quote(1,15)::>]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[end-block-quote:::False]",
         "[end-olist:::False]",
         "[end-block-quote:::False]",
@@ -3453,7 +3451,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_ordered_max_block_max_empty_no_bq3():
     """
     Verify that a nesting of block quote, ordered list, block quote, with
@@ -3466,10 +3463,9 @@ def test_nested_three_block_max_ordered_max_block_max_empty_no_bq3():
                 item"""
     expected_tokens = [
         "[block-quote(1,4):   :   > ]",
-        "[olist(1,9):.:1:14:   :]",
+        "[olist(1,9):.:1:14:   ]",
         "[block-quote(1,15)::>]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[end-block-quote:::False]",
         "[end-olist:::False]",
         "[end-block-quote:::False]",
diff --git a/test/test_markdown_nested_three_block_unordered.py b/test/test_markdown_nested_three_block_unordered.py
index b49defc1..95dbaafd 100644
--- a/test/test_markdown_nested_three_block_unordered.py
+++ b/test/test_markdown_nested_three_block_unordered.py
@@ -3301,7 +3301,6 @@ def test_nested_three_block_max_unordered_max_block_max_no_bq1():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_unordered_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of block quote, unordered list, block quote, with
@@ -3314,10 +3313,9 @@ def test_nested_three_block_max_unordered_max_block_max_empty_no_bq1():
              > item"""
     expected_tokens = [
         "[block-quote(1,4):   :   > ]",
-        "[ulist(1,9):+::13:   :]",
+        "[ulist(1,9):+::13:   ]",
         "[block-quote(1,14)::>]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[end-ulist:::False]",
         "[end-block-quote:::False]",
@@ -3453,7 +3451,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_block_max_unordered_max_block_max_empty_no_bq3():
     """
     Verify that a nesting of block quote, unordered list, block quote, with
@@ -3466,10 +3463,9 @@ def test_nested_three_block_max_unordered_max_block_max_empty_no_bq3():
                item"""
     expected_tokens = [
         "[block-quote(1,4):   :   > ]",
-        "[ulist(1,9):+::13:   :]",
+        "[ulist(1,9):+::13:   ]",
         "[block-quote(1,14)::>]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[end-ulist:::False]",
         "[end-block-quote:::False]",
diff --git a/test/test_markdown_nested_three_ordered_block.py b/test/test_markdown_nested_three_ordered_block.py
index a94ecd66..7f4f4250 100644
--- a/test/test_markdown_nested_three_ordered_block.py
+++ b/test/test_markdown_nested_three_ordered_block.py
@@ -57,7 +57,7 @@ def test_nested_three_ordered_nl_block_nl_unordered():
    > + list
    >   item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::]",
+        "[olist(1,1):.:1:3:]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n   > \n   > ]",
         "[BLANK(2,5):]",
@@ -97,7 +97,7 @@ def test_nested_three_ordered_nl_block_nl_unordered_wo_bq():
      + list
    >   item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n]",
+        "[olist(1,1):.:1:3::]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -277,7 +277,7 @@ def test_nested_three_ordered_nl_block_skip_nl_unordered():
    > + list
        item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::]",
+        "[olist(1,1):.:1:3:]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n   > \n]",
         "[BLANK(2,5):]",
@@ -317,7 +317,7 @@ def test_nested_three_ordered_nl_block_skip_nl_unordered_wo_bq():
      + list
        item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::]",
+        "[olist(1,1):.:1:3:]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -483,7 +483,7 @@ def test_nested_three_ordered_nl_block_nl_ordered():
    > 1. list
    >    item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::]",
+        "[olist(1,1):.:1:3:]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n   > \n   > ]",
         "[BLANK(2,5):]",
@@ -523,7 +523,7 @@ def test_nested_three_ordered_nl_block_nl_ordered_wo_bq():
      1. list
    >    item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n]",
+        "[olist(1,1):.:1:3::]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -703,7 +703,7 @@ def test_nested_three_ordered_nl_block_skip_nl_ordered():
    > 1. list
         item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::]",
+        "[olist(1,1):.:1:3:]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n   > \n]",
         "[BLANK(2,5):]",
@@ -743,7 +743,7 @@ def test_nested_three_ordered_nl_block_skip_nl_ordered_wo_bq():
      1. list
         item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::]",
+        "[olist(1,1):.:1:3:]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -909,7 +909,7 @@ def test_nested_three_ordered_nl_block_nl_block_x():
    > > list
    > > item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n]",
+        "[olist(1,1):.:1:3::\n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -949,7 +949,7 @@ def test_nested_three_ordered_nl_block_nl_block_wo_bq():
      > list
    > > item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n]",
+        "[olist(1,1):.:1:3::\n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n     > ]",
         "[BLANK(2,5):]",
@@ -1118,7 +1118,7 @@ def test_nested_three_ordered_nl_block_skip_nl_block():
    > > list
      > item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n]",
+        "[olist(1,1):.:1:3::\n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -1158,7 +1158,7 @@ def test_nested_three_ordered_nl_block_skip_nl_block_wo_bq():
      > list
      > item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n]",
+        "[olist(1,1):.:1:3::\n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n     > \n     > ]",
         "[BLANK(2,5):]",
@@ -1313,7 +1313,7 @@ def test_nested_three_ordered_nl_block_nl_block_skip():
    > > list
    >   item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n]",
+        "[olist(1,1):.:1:3::\n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -1353,7 +1353,7 @@ def test_nested_three_ordered_nl_block_nl_block_skip_wo_bq():
      > list
    >   item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n]",
+        "[olist(1,1):.:1:3::\n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >\n     > \n   > ]",
         "[BLANK(2,5):]",
@@ -1496,6 +1496,7 @@ item</p>
 
 
 @pytest.mark.gfm
+@pytest.mark.skip
 def test_nested_three_ordered_nl_block_skip_nl_block_skip():
     """
     Verify that a nesting of ordered list, block quote, block quote works
@@ -1508,7 +1509,7 @@ def test_nested_three_ordered_nl_block_skip_nl_block_skip():
    > > list
        item"""
     expected_tokens = [
-        "[olist(1,1):.:1:3::\n\n   \n]",
+        "[olist(1,1):.:1:3::\n   \n]",
         "[BLANK(1,3):]",
         "[block-quote(2,4):   :   >]",
         "[BLANK(2,5):]",
@@ -2343,7 +2344,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_block_max_block_max_empty():
     """
     Verify that a nesting of ordered list, block quote, block quote, with
@@ -2354,11 +2354,10 @@ def test_nested_three_ordered_max_block_max_block_max_empty():
     source_markdown = """   1.    >    >
          >    > item"""
     expected_tokens = [
-        "[olist(1,4):.:1:9:   :\n]",
+        "[olist(1,4):.:1:9:   :]",
         "[block-quote(1,10):         :         > ]",
         "[block-quote(1,15)::         >    >\n         >    > ]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[para(2,17):]",
         "[text(2,17):item:]",
         "[end-para:::True]",
@@ -2418,7 +2417,6 @@ def test_nested_three_ordered_max_block_max_block_max_no_bq1():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_block_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of ordered list, block quote, block quote, with
@@ -2430,11 +2428,10 @@ def test_nested_three_ordered_max_block_max_block_max_empty_no_bq1():
     source_markdown = """   1.    >    >
               > item"""
     expected_tokens = [
-        "[olist(1,4):.:1:9:   :\n         ]",
+        "[olist(1,4):.:1:9:   :         ]",
         "[block-quote(1,10):         :         > ]",
         "[block-quote(1,15)::         >    >]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[end-block-quote:::True]",
         "[end-block-quote:::True]",
         "[icode-block(2,14):    :]",
@@ -2572,7 +2569,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_block_max_block_max_empty_no_bq3():
     """
     Verify that a nesting of ordered list, block quote, block quote, with
@@ -2584,11 +2580,10 @@ def test_nested_three_ordered_max_block_max_block_max_empty_no_bq3():
     source_markdown = """   1.    >    >
                 item"""
     expected_tokens = [
-        "[olist(1,4):.:1:9:   :\n         ]",
+        "[olist(1,4):.:1:9:   :         ]",
         "[block-quote(1,10):         :         > ]",
         "[block-quote(1,15)::         >    >]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[end-block-quote:::True]",
         "[end-block-quote:::True]",
         "[icode-block(2,14):    :]",
diff --git a/test/test_markdown_nested_three_ordered_ordered.py b/test/test_markdown_nested_three_ordered_ordered.py
index 6a68c0c6..237b310f 100644
--- a/test/test_markdown_nested_three_ordered_ordered.py
+++ b/test/test_markdown_nested_three_ordered_ordered.py
@@ -877,7 +877,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_ordered_max_block_max_empty():
     """
     Verify that a nesting of ordered list, ordered list, block quote, with
@@ -889,10 +888,9 @@ def test_nested_three_ordered_max_ordered_max_block_max_empty():
                > item"""
     expected_tokens = [
         "[olist(1,4):.:1:9:   ]",
-        "[olist(1,10):.:1:15:         :\n]",
+        "[olist(1,10):.:1:15:         :]",
         "[block-quote(1,16):               :               >\n               > ]",
         "[BLANK(1,17):]",
-        "[BLANK(1,17):]",
         "[para(2,18):]",
         "[text(2,18):item:]",
         "[end-para:::True]",
@@ -956,7 +954,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_ordered_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of ordered list, ordered list, block quote, with
@@ -969,10 +966,9 @@ def test_nested_three_ordered_max_ordered_max_block_max_empty_no_bq1():
                  item"""
     expected_tokens = [
         "[olist(1,4):.:1:9:   ]",
-        "[olist(1,10):.:1:15:         :\n               \n]",
+        "[olist(1,10):.:1:15:         :               \n]",
         "[block-quote(1,16):               :               >]",
         "[BLANK(1,17):]",
-        "[BLANK(1,17):]",
         "[end-block-quote:::False]",
         "[para(2,18):  ]",
         "[text(2,18):item:]",
diff --git a/test/test_markdown_nested_three_ordered_unordered.py b/test/test_markdown_nested_three_ordered_unordered.py
index 7eef875b..a0f16c83 100644
--- a/test/test_markdown_nested_three_ordered_unordered.py
+++ b/test/test_markdown_nested_three_ordered_unordered.py
@@ -877,7 +877,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_unordered_max_block_max_empty():
     """
     Verify that a nesting of ordered list, unordered list, block quote, with
@@ -889,10 +888,9 @@ def test_nested_three_ordered_max_unordered_max_block_max_empty():
               > item"""
     expected_tokens = [
         "[olist(1,4):.:1:9:   ]",
-        "[ulist(1,10):+::14:         :\n]",
+        "[ulist(1,10):+::14:         :]",
         "[block-quote(1,15):              :              >\n              > ]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[para(2,17):]",
         "[text(2,17):item:]",
         "[end-para:::True]",
@@ -956,7 +954,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_ordered_max_unordered_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of ordered list, unordered list, block quote, with
@@ -969,10 +966,9 @@ def test_nested_three_ordered_max_unordered_max_block_max_empty_no_bq1():
                 item"""
     expected_tokens = [
         "[olist(1,4):.:1:9:   ]",
-        "[ulist(1,10):+::14:         :\n              \n]",
+        "[ulist(1,10):+::14:         :              \n]",
         "[block-quote(1,15):              :              >]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[end-block-quote:::False]",
         "[para(2,17):  ]",
         "[text(2,17):item:]",
diff --git a/test/test_markdown_nested_three_unordered_block.py b/test/test_markdown_nested_three_unordered_block.py
index 2c7eeeee..f21f544e 100644
--- a/test/test_markdown_nested_three_unordered_block.py
+++ b/test/test_markdown_nested_three_unordered_block.py
@@ -57,7 +57,7 @@ def test_nested_three_unordered_nl_block_nl_unordered():
   > + list
   >   item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::]",
+        "[ulist(1,1):+::2:]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >\n  > \n  > ]",
         "[BLANK(2,4):]",
@@ -97,7 +97,7 @@ def test_nested_three_unordered_nl_block_nl_unordered_wo_bq():
     + list
   >   item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n]",
+        "[ulist(1,1):+::2::]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -277,7 +277,7 @@ def test_nested_three_unordered_nl_block_skip_nl_unordered():
     + list
       item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::]",
+        "[ulist(1,1):+::2:]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -317,7 +317,7 @@ def test_nested_three_unordered_nl_block_skip_nl_unordered_wo_bq():
     + list
       item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::]",
+        "[ulist(1,1):+::2:]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -483,7 +483,7 @@ def test_nested_three_unordered_nl_block_nl_ordered():
   > 1. list
   >    item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::]",
+        "[ulist(1,1):+::2:]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >\n  > \n  > ]",
         "[BLANK(2,4):]",
@@ -523,7 +523,7 @@ def test_nested_three_unordered_nl_block_nl_ordered_wo_bq():
     1. list
   >    item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n]",
+        "[ulist(1,1):+::2::]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -703,7 +703,7 @@ def test_nested_three_unordered_nl_block_skip_nl_ordered():
     1. list
        item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::]",
+        "[ulist(1,1):+::2:]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -743,7 +743,7 @@ def test_nested_three_unordered_nl_block_skip_nl_ordered_wo_bq():
     1. list
        item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::]",
+        "[ulist(1,1):+::2:]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -909,7 +909,7 @@ def test_nested_three_unordered_nl_block_nl_block_x():
   > > list
   > > item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n]",
+        "[ulist(1,1):+::2::\n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -949,7 +949,7 @@ def test_nested_three_unordered_nl_block_nl_block_wo_bq():
     > list
   > > item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n]",
+        "[ulist(1,1):+::2::\n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >\n    > ]",
         "[BLANK(2,4):]",
@@ -1118,7 +1118,7 @@ def test_nested_three_unordered_nl_block_skip_nl_block_x():
   > > list
     > item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n]",
+        "[ulist(1,1):+::2::\n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -1158,7 +1158,7 @@ def test_nested_three_unordered_nl_block_skip_nl_block_wo_bq():
     > list
     > item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n]",
+        "[ulist(1,1):+::2::\n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >\n    > \n    > ]",
         "[BLANK(2,4):]",
@@ -1313,7 +1313,7 @@ def test_nested_three_unordered_nl_block_nl_block_skip():
   > > list
   >   item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n]",
+        "[ulist(1,1):+::2::\n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -1353,7 +1353,7 @@ def test_nested_three_unordered_nl_block_nl_block_skip_wo_bq():
     > list
   >   item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n]",
+        "[ulist(1,1):+::2::\n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >\n    > \n  > ]",
         "[BLANK(2,4):]",
@@ -1496,6 +1496,7 @@ item</p>
 
 
 @pytest.mark.gfm
+@pytest.mark.skip
 def test_nested_three_unordered_nl_block_skip_nl_block_skip():
     """
     Verify that a nesting of unordered list, new line, block quote, new line, block quote works
@@ -1508,7 +1509,7 @@ def test_nested_three_unordered_nl_block_skip_nl_block_skip():
   > > list
       item"""
     expected_tokens = [
-        "[ulist(1,1):+::2::\n\n  \n]",
+        "[ulist(1,1):+::2::\n  \n]",
         "[BLANK(1,2):]",
         "[block-quote(2,3):  :  >]",
         "[BLANK(2,4):]",
@@ -2364,7 +2365,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_block_max_block_max_empty():
     """
     Verify that a nesting of unordered list, block quote, block quote, with
@@ -2375,11 +2375,10 @@ def test_nested_three_unordered_max_block_max_block_max_empty():
     source_markdown = """   +    >    >
         >    > item"""
     expected_tokens = [
-        "[ulist(1,4):+::8:   :\n]",
+        "[ulist(1,4):+::8:   :]",
         "[block-quote(1,9):        :        > ]",
         "[block-quote(1,14)::        >    >\n        >    > ]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[para(2,16):]",
         "[text(2,16):item:]",
         "[end-para:::True]",
@@ -2439,7 +2438,6 @@ def test_nested_three_unordered_max_block_max_block_max_no_bq1():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_block_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of unordered list, block quote, block quote, with
@@ -2451,11 +2449,10 @@ def test_nested_three_unordered_max_block_max_block_max_empty_no_bq1():
     source_markdown = """   +    >    >
              > item"""
     expected_tokens = [
-        "[ulist(1,4):+::8:   :\n        ]",
+        "[ulist(1,4):+::8:   :        ]",
         "[block-quote(1,9):        :        > ]",
         "[block-quote(1,14)::        >    >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::True]",
         "[end-block-quote:::True]",
         "[icode-block(2,13):    :]",
@@ -2593,7 +2590,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_block_max_block_max_empty_no_bq3():
     """
     Verify that a nesting of unordered list, block quote, block quote, with
@@ -2605,11 +2601,10 @@ def test_nested_three_unordered_max_block_max_block_max_empty_no_bq3():
     source_markdown = """   +    >    >
                item"""
     expected_tokens = [
-        "[ulist(1,4):+::8:   :\n        ]",
+        "[ulist(1,4):+::8:   :        ]",
         "[block-quote(1,9):        :        > ]",
         "[block-quote(1,14)::        >    >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::True]",
         "[end-block-quote:::True]",
         "[icode-block(2,13):    :]",
diff --git a/test/test_markdown_nested_three_unordered_ordered.py b/test/test_markdown_nested_three_unordered_ordered.py
index 4bb56f2b..c66380cc 100644
--- a/test/test_markdown_nested_three_unordered_ordered.py
+++ b/test/test_markdown_nested_three_unordered_ordered.py
@@ -877,7 +877,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_ordered_max_block_max_empty():
     """
     Verify that a nesting of unordered list, ordered list, block quote, with
@@ -889,10 +888,9 @@ def test_nested_three_unordered_max_ordered_max_block_max_empty():
               > item"""
     expected_tokens = [
         "[ulist(1,4):+::8:   ]",
-        "[olist(1,9):.:1:14:        :\n]",
+        "[olist(1,9):.:1:14:        :]",
         "[block-quote(1,15):              :              >\n              > ]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[para(2,17):]",
         "[text(2,17):item:]",
         "[end-para:::True]",
@@ -956,7 +954,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_ordered_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of unordered list, ordered list, block quote, with
@@ -969,10 +966,9 @@ def test_nested_three_unordered_max_ordered_max_block_max_empty_no_bq1():
                 item"""
     expected_tokens = [
         "[ulist(1,4):+::8:   ]",
-        "[olist(1,9):.:1:14:        :\n              \n]",
+        "[olist(1,9):.:1:14:        :              \n]",
         "[block-quote(1,15):              :              >]",
         "[BLANK(1,16):]",
-        "[BLANK(1,16):]",
         "[end-block-quote:::False]",
         "[para(2,17):  ]",
         "[text(2,17):item:]",
@@ -992,7 +988,7 @@ item</li>
 </ul>"""
 
     # Act & Assert
-    act_and_assert(source_markdown, expected_gfm, expected_tokens)
+    act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=True)
 
 
 @pytest.mark.gfm
diff --git a/test/test_markdown_nested_three_unordered_unordered.py b/test/test_markdown_nested_three_unordered_unordered.py
index 0674bf83..0c9254ef 100644
--- a/test/test_markdown_nested_three_unordered_unordered.py
+++ b/test/test_markdown_nested_three_unordered_unordered.py
@@ -878,7 +878,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_unordered_max_block_max_empty():
     """
     Verify that a nesting of unordered list, unordered list, block quote, with
@@ -890,10 +889,9 @@ def test_nested_three_unordered_max_unordered_max_block_max_empty():
              > item"""
     expected_tokens = [
         "[ulist(1,4):+::8:   ]",
-        "[ulist(1,9):+::13:        :\n]",
+        "[ulist(1,9):+::13:        :]",
         "[block-quote(1,14):             :             >\n             > ]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[para(2,16):]",
         "[text(2,16):item:]",
         "[end-para:::True]",
@@ -957,7 +955,6 @@ item</p>
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_nested_three_unordered_max_unordered_max_block_max_empty_no_bq1():
     """
     Verify that a nesting of unordered list, unordered list, block quote, with
@@ -970,10 +967,9 @@ def test_nested_three_unordered_max_unordered_max_block_max_empty_no_bq1():
                item"""
     expected_tokens = [
         "[ulist(1,4):+::8:   ]",
-        "[ulist(1,9):+::13:        :\n             \n]",
+        "[ulist(1,9):+::13:        :             \n]",
         "[block-quote(1,14):             :             >]",
         "[BLANK(1,15):]",
-        "[BLANK(1,15):]",
         "[end-block-quote:::False]",
         "[para(2,16):  ]",
         "[text(2,16):item:]",
diff --git a/test/test_markdown_paragraph_series_n.py b/test/test_markdown_paragraph_series_n.py
index a9b5b49f..db1749ec 100644
--- a/test/test_markdown_paragraph_series_n.py
+++ b/test/test_markdown_paragraph_series_n.py
@@ -1130,7 +1130,7 @@ def test_paragraph_series_n_ul_t_nl_i2_bq_t_nl_bq_nl_i2_bq_ib():
   >     def
 * def"""
     expected_tokens = [
-        "[ulist(1,1):*::2::\n\n]",
+        "[ulist(1,1):*::2::\n]",
         "[para(1,3):]",
         "[text(1,3):abc:]",
         "[end-para:::True]",
diff --git a/test/transform_to_markdown.py b/test/transform_to_markdown.py
index 40e2baed..12c283c7 100644
--- a/test/transform_to_markdown.py
+++ b/test/transform_to_markdown.py
@@ -265,6 +265,9 @@ class TransformToMarkdown:
                 else None
             )
 
+            print(
+                f"pre-h>current_token>:{ParserHelper.make_value_visible(current_token)}:"
+            )
             (new_data, pragma_token,) = self.__process_next_token(
                 current_token,
                 previous_token,
@@ -274,9 +277,15 @@ class TransformToMarkdown:
                 token_index,
             )
 
-            print(f"post-h>new_data>{ParserHelper.make_value_visible(new_data)}")
+            print(f"post-h>new_data>:{ParserHelper.make_value_visible(new_data)}:")
             transformed_data_length_before_add = len(transformed_data)
+            print(
+                f"post-h>transformed_data>:{ParserHelper.make_value_visible(transformed_data)}:"
+            )
             transformed_data += new_data
+            print(
+                f"post-h>transformed_data>:{ParserHelper.make_value_visible(transformed_data)}:"
+            )
 
             if (
                 current_token.is_block_quote_start
@@ -554,7 +563,7 @@ class TransformToMarkdown:
         container_token_indices,
     ):
         adj_line = ""
-        print("adj_line->:" + adj_line + ":")
+        print(f"adj_line->:{adj_line}:")
         adj_line = cls.__adjust(
             nested_list_start_index - 1,
             token_stack,
@@ -562,7 +571,7 @@ class TransformToMarkdown:
             adj_line,
             True,
         )
-        print("adj_line->:" + adj_line + ":")
+        print(f"adj_line->:{adj_line}:")
         adj_line = cls.__adjust(
             nested_list_start_index,
             token_stack,
@@ -570,7 +579,7 @@ class TransformToMarkdown:
             adj_line,
             True,
         )
-        print("adj_line->:" + adj_line + ":")
+        print(f"adj_line->:{adj_line}:")
         container_line = adj_line + container_line
         return container_line
 
@@ -658,9 +667,12 @@ class TransformToMarkdown:
             delta = previous_token.indent_level - len(container_line)
             print("delta->" + str(delta))
             container_line += ParserHelper.repeat_string(" ", delta)
-        split_leading_spaces = previous_token.leading_spaces.split(
-            ParserHelper.newline_character
+        leading_spaces = (
+            ""
+            if previous_token.leading_spaces is None
+            else previous_token.leading_spaces
         )
+        split_leading_spaces = leading_spaces.split(ParserHelper.newline_character)
         inner_token_index = container_token_indices[nested_list_start_index]
         if inner_token_index < len(split_leading_spaces):
             print(
@@ -784,11 +796,14 @@ class TransformToMarkdown:
     # pylint: enable=too-many-locals
 
     def __look_for_last_block_token(self):
-        found_block_token = None
-        for i in range(len(self.container_token_stack) - 1, -1, -1):
-            if self.container_token_stack[i].is_block_quote_start:
-                found_block_token = self.container_token_stack[i]
-                break
+        found_block_token = next(
+            (
+                self.container_token_stack[i]
+                for i in range(len(self.container_token_stack) - 1, -1, -1)
+                if self.container_token_stack[i].is_block_quote_start
+            ),
+            None,
+        )
         print(
             f">>found_block_token>>{ParserHelper.make_value_visible(found_block_token)}<"
         )
@@ -1558,11 +1573,14 @@ class TransformToMarkdown:
         Deal with re-inserting any removed whitespace at the starts of lines.
         """
         if ParserHelper.newline_character in text_to_modify:
-            owning_paragraph_token = None
-            for search_index in range(len(self.block_stack) - 1, -1, -1):
-                if self.block_stack[search_index].is_paragraph:
-                    owning_paragraph_token = self.block_stack[search_index]
-                    break
+            owning_paragraph_token = next(
+                (
+                    self.block_stack[search_index]
+                    for search_index in range(len(self.block_stack) - 1, -1, -1)
+                    if self.block_stack[search_index].is_paragraph
+                ),
+                None,
+            )
 
             print(f"text>before>{ParserHelper.make_value_visible(text_to_modify)}")
             text_to_modify = ParserHelper.remove_all_from_text(text_to_modify)