Repository: jackdewinter/pymarkdown

Issue:
MD032 triggers wrongly with deeper levels of nesting
- test_extra_034d
- test_extra_034e

These are firing saying that the list is not properly surrounded by blank lines, when it is.  Likely cause is some sort of nesting issues with current round of deeper nesting.

Discussion:

Patch:
diff --git a/publish/coverage.json b/publish/coverage.json
index 3bf0314e..768be2ed 100644
--- a/publish/coverage.json
+++ b/publish/coverage.json
@@ -6,8 +6,8 @@
         "totalCovered": 4297
     },
     "lineLevel": {
-        "totalMeasured": 17932,
-        "totalCovered": 17932
+        "totalMeasured": 17934,
+        "totalCovered": 17934
     }
 }
 
diff --git a/pymarkdown/plugins/rule_md_032.py b/pymarkdown/plugins/rule_md_032.py
index 94c1043e..3becc95b 100644
--- a/pymarkdown/plugins/rule_md_032.py
+++ b/pymarkdown/plugins/rule_md_032.py
@@ -42,6 +42,28 @@ class RuleMd032(RulePlugin):
         self.__container_token_stack = []
         self.__end_list_end_token = None
 
+    def __next_token_list_start(
+        self, context: PluginScanContext, token: MarkdownToken
+    ) -> None:
+        if (
+            self.__last_non_end_token
+            and not self.__last_non_end_token.is_blank_line
+            and not (
+                self.__container_token_stack
+                and (
+                    self.__container_token_stack[-1].is_list_start
+                    or (
+                        self.__container_token_stack[-1].is_block_quote_start
+                        and self.__container_token_stack[-1].line_number
+                        == token.line_number
+                    )
+                )
+            )
+        ):
+            self.report_next_token_error(context, token)
+
+        self.__container_token_stack.append(token)
+
     def next_token(self, context: PluginScanContext, token: MarkdownToken) -> None:
         """
         Event that a new token is being processed.
@@ -61,17 +83,7 @@ class RuleMd032(RulePlugin):
         elif token.is_block_quote_end:
             del self.__container_token_stack[-1]
         elif token.is_list_start:
-            if (
-                self.__last_non_end_token
-                and not (
-                    self.__container_token_stack
-                    and self.__container_token_stack[-1].is_list_start
-                )
-                and not self.__last_non_end_token.is_blank_line
-            ):
-                self.report_next_token_error(context, token)
-
-            self.__container_token_stack.append(token)
+            self.__next_token_list_start(context, token)
         elif token.is_list_end:
             assert self.__last_non_end_token is not None
             if not self.__last_non_end_token.is_blank_line:


Test patch:
diff --git a/publish/test-results.json b/publish/test-results.json
index 817dff60..4d484a28 100644
--- a/publish/test-results.json
+++ b/publish/test-results.json
@@ -1631,7 +1631,7 @@
             "totalTests": 110,
             "failedTests": 0,
             "errorTests": 0,
-            "skippedTests": 2,
+            "skippedTests": 0,
             "elapsedTimeInMilliseconds": 0
         },
         {
diff --git a/test/test_markdown_extra.py b/test/test_markdown_extra.py
index 59af7bec..2cefe6fc 100644
--- a/test/test_markdown_extra.py
+++ b/test/test_markdown_extra.py
@@ -4572,7 +4572,6 @@ def test_extra_033a():
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_extra_034d():
     """
     TBD - from https://github.com/jackdewinter/pymarkdown/issues/731
@@ -4609,7 +4608,6 @@ block
 
 
 @pytest.mark.gfm
-@pytest.mark.skip
 def test_extra_034e():
     """
     TBD - from https://github.com/jackdewinter/pymarkdown/issues/731