Repository: jackdewinter/pymarkdown

Issue:
Refactoring Container Processor

Discussion:
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.16%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 3.94 ⭐ | 3.83 ⭐ | -0.11 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 87.17 🙂 | 92.66 🙂 | 5.49 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 10.38 😞 | 10.62 😞 | 0.24 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **63.56%** 🙂| **63.40%** 🙂| **-0.16%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 14470 | 10998 | -3472 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| pymarkdown/block\_quote\_processor.py | 54.69% 🙂 | 54.69% 🙂 | 0.00% |
| pymarkdown/list\_block\_processor.py | 54.45% 🙂 | 54.45% 🙂 | 0.00% |
| pymarkdown/tokenized\_markdown.py | 63.00% 🙂 | 63.00% 🙂 | 0.00% |
| pymarkdown/html/html\_raw\_helper.py | 59.55% 🙂 | 59.55% 🙂 | 0.00% |
| pymarkdown/inline/inline\_autolink\_helper.py | 47.12% 😞 | 47.12% 😞 | 0.00% |
| pymarkdown/leaf\_blocks/atx\_leaf\_block\_processor.py | 54.67% 🙂 | 54.67% 🙂 | 0.00% |
| pymarkdown/leaf\_blocks/fenced\_leaf\_block\_processor.py | 57.49% 🙂 | 57.49% 🙂 | 0.00% |
| pymarkdown/leaf\_blocks/leaf\_block\_processor.py | 59.14% 🙂 | 59.13% 🙂 | -0.01% 👎|
| pymarkdown/leaf\_blocks/thematic\_leaf\_block\_processor.py | 43.34% 😞 | 43.34% 😞 | 0.00% |
| test/test\_main.py | 76.52% ⭐ | 76.52% ⭐ | 0.00% |
| test/basic/test\_complete\_html\_tags.py | 85.21% ⭐ | 85.21% ⭐ | 0.00% |
| test/basic/test\_container\_grab\_bag.py | 96.65% ⭐ | 96.48% ⭐ | -0.17% 👎|
| test/basic/test\_html\_tags.py | 89.96% ⭐ | 89.96% ⭐ | 0.00% |

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| pymarkdown/list\_block\_processor.py | ListBlockProcessor.list\_in\_process | 7 ⭐ | 232 ⛔ | 16 ⛔ | 40.37% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| pymarkdown/leaf\_blocks/thematic\_leaf\_block\_processor.py | ThematicLeafBlockProcessor.is\_thematic\_break | 14 🙂 | 164 😞 | 15 😞 | 40.40% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| pymarkdown/list\_block\_processor.py | ListBlockProcessor.\_\_post\_list | 7 ⭐ | 185 😞 | 19 ⛔ | 41.09% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| pymarkdown/tokenized\_markdown.py | TokenizedMarkdown.\_\_handle\_blank\_line | 10 🙂 | 207 ⛔ | 14 😞 | 41.57% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| pymarkdown/tokenized\_markdown.py | TokenizedMarkdown.\_\_handle\_blank\_line\_token\_stack | 8 ⭐ | 194 😞 | 16 ⛔ | 42.02% 😞 | Try splitting into smaller methods. Extract out complex expressions |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=jackdewinter&base_repo=https%3A%2F%2Fgithub.com%2Fjackdewinter%2Fpymarkdown.git&base_remote_ref=refs%2Fpull%2F604%2Fhead&base_ref=issue-600&base_sha=4a07f8f4e1cdfefd5b854f0d2998fe2ba9c50538&head_repo=https%3A%2F%2Fgithub.com%2Fjackdewinter%2Fpymarkdown.git&head_ref=sourcery%2Fissue-600&base_pr_number=604&base_pr_state=open) this quality report!

Patch:
diff --git a/publish/coverage.json b/publish/coverage.json
index 229739c9..d428a929 100644
--- a/publish/coverage.json
+++ b/publish/coverage.json
@@ -6,8 +6,8 @@
         "totalCovered": 3581
     },
     "lineLevel": {
-        "totalMeasured": 14501,
-        "totalCovered": 14501
+        "totalMeasured": 14533,
+        "totalCovered": 14533
     }
 }
 
diff --git a/publish/pylint_suppression.json b/publish/pylint_suppression.json
index 883b273f..b1cb8195 100644
--- a/publish/pylint_suppression.json
+++ b/publish/pylint_suppression.json
@@ -16,25 +16,30 @@
             "too-few-public-methods": 1
         },
         "pymarkdown/constants.py": {},
-        "pymarkdown/container_block_leaf_processor.py": {
+        "pymarkdown/container_blocks/container_block_leaf_processor.py": {
             "too-few-public-methods": 1,
             "too-many-arguments": 5,
             "chained-comparison": 1,
             "too-many-boolean-expressions": 1
         },
-        "pymarkdown/container_block_processor.py": {
+        "pymarkdown/container_blocks/container_block_nested_processor.py": {
             "too-few-public-methods": 1,
-            "too-many-arguments": 2
+            "too-many-arguments": 1
+        },
+        "pymarkdown/container_blocks/container_block_non_leaf_processor.py": {},
+        "pymarkdown/container_blocks/container_block_processor.py": {
+            "too-few-public-methods": 1,
+            "too-many-arguments": 1
         },
-        "pymarkdown/container_grab_bag.py": {
+        "pymarkdown/container_blocks/container_grab_bag.py": {
             "too-many-instance-attributes": 1,
             "too-many-public-methods": 1,
             "too-many-arguments": 1
         },
-        "pymarkdown/container_helper.py": {
+        "pymarkdown/container_blocks/container_helper.py": {
             "too-few-public-methods": 1
         },
-        "pymarkdown/container_indices.py": {},
+        "pymarkdown/container_blocks/container_indices.py": {},
         "pymarkdown/container_markdown_token.py": {
             "too-many-arguments": 4,
             "too-many-instance-attributes": 1
@@ -310,7 +315,7 @@
     "disables-by-name": {
         "too-many-arguments": 172,
         "too-many-locals": 16,
-        "too-few-public-methods": 20,
+        "too-few-public-methods": 21,
         "chained-comparison": 1,
         "too-many-boolean-expressions": 1,
         "too-many-instance-attributes": 19,
diff --git a/pymarkdown/block_quote_processor.py b/pymarkdown/block_quote_processor.py
index bfd75509..f2b3f386 100644
--- a/pymarkdown/block_quote_processor.py
+++ b/pymarkdown/block_quote_processor.py
@@ -5,7 +5,7 @@ import logging
 from typing import List, Optional, Tuple, cast
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
 from pymarkdown.container_markdown_token import (
     BlockQuoteMarkdownToken,
     ListStartMarkdownToken,
diff --git a/pymarkdown/container_block_processor.py b/pymarkdown/container_block_processor.py
deleted file mode 100644
index 073ce4d9..00000000
--- a/pymarkdown/container_block_processor.py
+++ /dev/null
@@ -1,1961 +0,0 @@
-"""
-Module to provide processing for the container blocks.
-"""
-from __future__ import annotations
-
-import copy
-import logging
-from typing import TYPE_CHECKING, List, Optional, Tuple, cast
-
-from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.block_quote_processor import BlockQuoteProcessor
-from pymarkdown.container_block_leaf_processor import ContainerBlockLeafProcessor
-from pymarkdown.container_grab_bag import ContainerGrabBag
-from pymarkdown.container_indices import ContainerIndices
-from pymarkdown.container_markdown_token import (
-    BlockQuoteMarkdownToken,
-    ListStartMarkdownToken,
-)
-from pymarkdown.extensions.pragma_token import PragmaExtension
-from pymarkdown.leaf_blocks.leaf_block_processor_paragraph import (
-    LeafBlockProcessorParagraph,
-)
-from pymarkdown.list_block_processor import ListBlockProcessor
-from pymarkdown.markdown_token import EndMarkdownToken, MarkdownToken
-from pymarkdown.parser_helper import ParserHelper
-from pymarkdown.parser_logger import ParserLogger
-from pymarkdown.parser_state import ParserState
-from pymarkdown.position_marker import PositionMarker
-from pymarkdown.requeue_line_info import RequeueLineInfo
-from pymarkdown.stack_token import ListStackToken
-from pymarkdown.tab_helper import TabHelper
-
-if TYPE_CHECKING:  # pragma: no cover
-    from pymarkdown.parse_block_pass_properties import ParseBlockPassProperties
-
-POGGER = ParserLogger(logging.getLogger(__name__))
-
-# pylint: disable=too-many-lines
-# pylint: disable=too-few-public-methods
-
-
-class ContainerBlockProcessor:
-    """
-    Class to provide processing for the container blocks.
-    """
-
-    @staticmethod
-    def __setup(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[PositionMarker, bool, bool]:
-        POGGER.debug(">>")
-        POGGER.debug(">>")
-        if ContainerBlockProcessor.__look_for_pragmas(
-            position_marker,
-            grab_bag,
-        ):
-            return position_marker, True, False
-
-        position_marker = ContainerBlockProcessor.__prepare_container_start_variables(
-            parser_state,
-            position_marker,
-            grab_bag,
-        )
-
-        ContainerBlockProcessor.__prepare_container_start_variables2(
-            parser_state, position_marker, grab_bag
-        )
-
-        is_not_in_root_list = not (
-            parser_state.token_stack
-            and len(parser_state.token_stack) >= 2
-            and parser_state.token_stack[1].is_list
-        )
-
-        POGGER.debug(
-            "position_marker>:$:$:",
-            position_marker.index_number,
-            position_marker.text_to_parse,
-        )
-        return (
-            position_marker,
-            False,
-            is_not_in_root_list,
-        )
-
-    # pylint: disable=too-many-arguments
-    @staticmethod
-    def parse_line_for_container_blocks(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        ignore_link_definition_start: bool,
-        parser_properties: ParseBlockPassProperties,
-        container_start_bq_count: int,
-        container_depth: int = 0,
-        adjusted_block_index: Optional[int] = None,
-        initial_block_quote_count: Optional[int] = None,
-        original_line: Optional[str] = None,
-    ) -> Tuple[
-        List[MarkdownToken],
-        Optional[str],
-        Optional[int],
-        Optional[RequeueLineInfo],
-        bool,
-        bool,
-    ]:
-        """
-        Parse the line, taking care to handle any container blocks before deciding
-        whether or not to pass the (remaining parts of the) line to the leaf block
-        processor.
-
-        Note: This is one of the more heavily traffic functions in the
-        parser.  Debugging should be uncommented only if needed.
-        """
-
-        grab_bag = ContainerGrabBag(
-            parser_state,
-            container_depth,
-            initial_block_quote_count,
-            adjusted_block_index,
-            container_start_bq_count,
-            parser_properties,
-            ignore_link_definition_start,
-            original_line
-            if original_line is not None
-            else position_marker.text_to_parse,
-        )
-        (
-            position_marker,
-            did_find_pragma,
-            is_not_in_root_list,
-        ) = ContainerBlockProcessor.__setup(
-            parser_state,
-            position_marker,
-            grab_bag,
-        )
-        if did_find_pragma:
-            return [], None, None, None, False, False
-        # POGGER.debug("position_marker.index_number>>$", position_marker.index_number)
-
-        # POGGER.debug(">>parser_state.token_stack:$", parser_state.token_stack)
-        # POGGER.debug(">>is_not_in_root_list=:$:", is_not_in_root_list)
-        assert grab_bag.extracted_whitespace is not None
-        if (
-            not grab_bag.container_depth
-            and len(grab_bag.extracted_whitespace) >= 4
-            and is_not_in_root_list
-        ):
-            POGGER.debug("indent")
-            ContainerBlockProcessor.__handle_indented_block_start(
-                parser_state, position_marker, grab_bag
-            )
-        else:
-            ContainerBlockProcessor.__handle_non_leaf_block(
-                parser_state,
-                position_marker,
-                grab_bag,
-            )
-
-        if (
-            grab_bag.can_continue
-            and not grab_bag.do_skip_containers_before_leaf_blocks
-            and not grab_bag.did_blank
-        ) or grab_bag.do_force_leaf_token_parse:
-            ContainerBlockProcessor.__handle_leaf_tokens(
-                parser_state,
-                position_marker,
-                grab_bag,
-            )
-
-        return (
-            grab_bag.container_tokens,
-            grab_bag.line_to_parse,
-            grab_bag.block_quote_data.current_count,
-            grab_bag.requeue_line_info,
-            grab_bag.did_blank,
-            grab_bag.do_force_list_continuation,
-        )
-        # pylint: enable=too-many-arguments
-
-    @staticmethod
-    def __look_for_override(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> bool:
-        if grab_bag.have_pre_processed_indent:
-            (
-                grab_bag.can_continue,
-                grab_bag.line_to_parse,
-                grab_bag.start_index,
-                grab_bag.removed_chars_at_start_of_line,
-            ) = (
-                True,
-                position_marker.text_to_parse[grab_bag.indent_already_processed :],
-                grab_bag.indent_already_processed,
-                grab_bag.indent_already_processed,
-            )
-        keep_processing = (
-            not grab_bag.can_continue
-            and not grab_bag.do_skip_containers_before_leaf_blocks
-        )
-        if keep_processing:
-            # POGGER.debug("parser_state.token_document=$", parser_state.token_document)
-            last_container_stack_token = parser_state.token_stack[
-                parser_state.find_last_container_on_stack()
-            ]
-            POGGER.debug("last_container_stack_token>>$", last_container_stack_token)
-            if last_container_stack_token.is_block_quote:
-                block_token = cast(
-                    BlockQuoteMarkdownToken,
-                    last_container_stack_token.matching_markdown_token,
-                )
-                assert block_token.bleading_spaces is not None
-                split_spaces = block_token.bleading_spaces.split(
-                    ParserHelper.newline_character
-                )
-                # POGGER.debug("split_spaces>>$", split_spaces)
-                last_leading_space = split_spaces[-1]
-                # POGGER.debug(
-                #     "last_leading_space>:$:($)",
-                #     last_leading_space,
-                #     len(last_leading_space),
-                # )
-                ex_ws_index, _ = ParserHelper.extract_spaces(last_leading_space, 0)
-                # POGGER.debug("ex_ws_index>:$", ex_ws_index)
-                assert grab_bag.adj_ws is not None
-                if (
-                    len(grab_bag.adj_ws) >= 4
-                    and grab_bag.indent_used_by_container
-                    and grab_bag.indent_used_by_container == ex_ws_index
-                ):
-                    keep_processing = False
-                    grab_bag.indent_already_processed = len(last_leading_space)
-                    grab_bag.weird_adjusted_text = last_leading_space
-                    # POGGER.debug(
-                    #     "position_marker.text_to_parse>:$:($)",
-                    #     position_marker.text_to_parse,
-                    #     len(position_marker.text_to_parse),
-                    # )
-                    # POGGER.debug("used_pre_indent>:$:", used_pre_indent)
-                    (
-                        grab_bag.can_continue,
-                        grab_bag.line_to_parse,
-                        grab_bag.start_index,
-                        grab_bag.removed_chars_at_start_of_line,
-                    ) = (
-                        True,
-                        position_marker.text_to_parse[
-                            grab_bag.indent_already_processed :
-                        ],
-                        grab_bag.indent_already_processed,
-                        grab_bag.indent_already_processed,
-                    )
-        return keep_processing
-
-    @staticmethod
-    def __handle_non_leaf_block(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        # POGGER.debug("ttp>>:$:<", position_marker.text_to_parse)
-        # POGGER.debug("index_number>>:$:<", position_marker.index_number)
-        # POGGER.debug("index_indent>>:$:<", position_marker.index_indent)
-        ContainerBlockProcessor.__handle_pre_processed_indent(
-            parser_state,
-            position_marker,
-            grab_bag,
-        )
-        # POGGER.debug("position_marker.index_number>>$", position_marker.index_number)
-        # assert grab_bag.extracted_whitespace is not None
-        if ContainerBlockProcessor.__look_for_override(
-            parser_state,
-            position_marker,
-            grab_bag,
-        ):
-            ContainerBlockProcessor.__handle_normal_containers(
-                parser_state,
-                position_marker,
-                grab_bag,
-            )
-
-    @staticmethod
-    def __calculate_indent_used_by_container(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        leading_whitespace: Optional[str],
-        grab_bag: ContainerGrabBag,
-    ) -> Optional[str]:
-        POGGER.debug("original_line_to_parse:$:", parser_state.original_line_to_parse)
-        POGGER.debug("leading_whitespace:$:", leading_whitespace)
-        POGGER.debug("text_to_parse=:$:", position_marker.text_to_parse)
-        POGGER.debug("parser_state.token_stack=:$:", parser_state.token_stack)
-        stack_search_index, current_indent = 1, 0
-        assert parser_state.original_line_to_parse is not None
-        while stack_search_index <= grab_bag.container_depth:
-            if parser_state.token_stack[stack_search_index].is_block_quote:
-                current_indent = parser_state.original_line_to_parse.find(">")
-                assert current_indent != -1
-                assert (
-                    parser_state.original_line_to_parse[current_indent + 1]
-                    == ParserHelper.space_character
-                )
-                current_indent += 1
-
-                # TODO add tests with no space between `>` and next block
-                assert (
-                    current_indent < len(parser_state.original_line_to_parse)
-                    and parser_state.original_line_to_parse[current_indent]
-                    == ParserHelper.space_character
-                )
-                current_indent += 1
-            else:
-                assert parser_state.token_stack[stack_search_index].is_list
-                list_token = cast(
-                    ListStartMarkdownToken, parser_state.token_stack[stack_search_index]
-                )
-                delta = list_token.indent_level - current_indent
-                POGGER.debug("delta=:$:", delta)
-                current_indent += delta
-            stack_search_index += 1
-        assert stack_search_index > grab_bag.container_depth
-        _, leading_whitespace = ParserHelper.extract_spaces(
-            parser_state.original_line_to_parse, current_indent
-        )
-        POGGER.debug("leading_whitespace=:$:", leading_whitespace)
-        grab_bag.indent_used_by_container = current_indent
-        return leading_whitespace
-
-    @staticmethod
-    def __special_list_block_block(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        if not (
-            parser_state.token_stack[1].is_list
-            and parser_state.token_stack[2].is_block_quote
-            and parser_state.token_stack[3].is_block_quote
-            and parser_state.token_stack[4].is_paragraph
-            and parser_state.token_stack[1].matching_markdown_token
-            and parser_state.token_stack[3].matching_markdown_token
-            and parser_state.token_stack[1].matching_markdown_token.line_number
-            == parser_state.token_stack[3].matching_markdown_token.line_number
-        ):
-            return
-        list_token = cast(
-            ListStartMarkdownToken,
-            parser_state.token_stack[1].matching_markdown_token,
-        )
-        container_x_used_indent = list_token.indent_level
-        assert grab_bag.extracted_whitespace is not None
-        extracted_whitespace_length = len(grab_bag.extracted_whitespace)
-        POGGER.debug("text_to_parse=:$:", position_marker.text_to_parse)
-        POGGER.debug(
-            "text_to_parse[rt($)]=:$:",
-            extracted_whitespace_length,
-            position_marker.text_to_parse[extracted_whitespace_length],
-        )
-        POGGER.debug("index_number=:$:", position_marker.index_number)
-        if not (
-            container_x_used_indent != extracted_whitespace_length
-            and position_marker.text_to_parse[extracted_whitespace_length] == ">"
-            and extracted_whitespace_length - container_x_used_indent >= 4
-        ):
-            return
-        list_token.add_leading_spaces(
-            grab_bag.extracted_whitespace[:container_x_used_indent]
-        )
-        (
-            grab_bag.do_skip_containers_before_leaf_blocks,
-            grab_bag.did_indent_processing,
-            grab_bag.have_pre_processed_indent,
-            grab_bag.do_force_leaf_token_parse,
-            grab_bag.indent_already_processed,
-        ) = (True, True, True, True, container_x_used_indent)
-
-    @staticmethod
-    def __determine_leading_whitespace_preprocessing(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        assert grab_bag.extracted_whitespace is not None
-        grab_bag.indent_used_by_container = 0
-        if grab_bag.is_para_continue and not grab_bag.container_depth:
-            ContainerBlockProcessor.__special_list_block_block(
-                parser_state, position_marker, grab_bag
-            )
-        elif not grab_bag.is_para_continue:
-            POGGER.debug(
-                "position_marker.index_number:$:", position_marker.index_number
-            )
-            leading_whitespace: Optional[str] = grab_bag.extracted_whitespace
-            if position_marker.index_number == -1 and grab_bag.container_depth:
-                leading_whitespace = (
-                    ContainerBlockProcessor.__calculate_indent_used_by_container(
-                        parser_state, position_marker, leading_whitespace, grab_bag
-                    )
-                )
-            assert leading_whitespace is not None
-            if len(leading_whitespace) >= 4:
-                POGGER.debug(">>leading_whitespace_processing")
-                ContainerBlockProcessor.__handle_leading_whitespace(
-                    parser_state,
-                    position_marker,
-                    leading_whitespace,
-                    grab_bag,
-                )
-                (
-                    grab_bag.did_indent_processing,
-                    grab_bag.was_indent_already_processed,
-                ) = (True, bool(grab_bag.container_depth))
-            POGGER.debug("parser_state.token_document=$", parser_state.token_document)
-
-    @staticmethod
-    def __handle_pre_processed_indent(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        # POGGER.debug("normal")
-        # POGGER.debug(
-        #     "container_depth=$ == len(containers)=$ - 1",
-        #     container_depth,
-        #     len(parser_state.token_stack) - 1,
-        # )
-        # POGGER.debug("token-stack:$", parser_state.token_stack)
-        # POGGER.debug("text_to_parse=:$:", position_marker.text_to_parse)
-        # POGGER.debug("index_number=:$:", position_marker.index_number)
-        # POGGER.debug("index_indent=:$:", position_marker.index_indent)
-        assert grab_bag.extracted_whitespace is not None
-        need_leading_whitespace_processing = (
-            grab_bag.container_depth < (len(parser_state.token_stack) - 1)
-            and len(grab_bag.extracted_whitespace) >= 4
-            and not parser_state.token_stack[-1].is_html_block
-            and not parser_state.token_stack[-1].is_fenced_code_block
-        )
-        need_trailing_indent_processing = (
-            grab_bag.container_depth >= len(parser_state.token_stack) - 1
-            and position_marker.index_number == -1
-        )
-        if need_trailing_indent_processing:
-            POGGER.debug(">>trailing_indent_processing")
-            ContainerBlockProcessor.__handle_trailing_indent_with_block_quote(
-                parser_state, grab_bag
-            )
-        elif need_leading_whitespace_processing:
-            POGGER.debug(">>leading_whitespace_preprocessing")
-            ContainerBlockProcessor.__determine_leading_whitespace_preprocessing(
-                parser_state,
-                position_marker,
-                grab_bag,
-            )
-
-    @staticmethod
-    def __handle_trailing_indent_with_block_quote(
-        parser_state: ParserState,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        grab_bag.did_indent_processing = True
-        assert grab_bag.extracted_whitespace is not None
-        for stack_capture_index in range(1, len(parser_state.token_stack)):
-            POGGER.debug(
-                "$>stack:$:",
-                stack_capture_index,
-                parser_state.token_stack[stack_capture_index],
-            )
-            inner_token = parser_state.token_stack[
-                stack_capture_index
-            ].matching_markdown_token
-            assert inner_token is not None
-            POGGER.debug(
-                "$>token:$:",
-                stack_capture_index,
-                inner_token,
-            )
-            if inner_token.is_block_quote_start:
-                block_quote_token = cast(BlockQuoteMarkdownToken, inner_token)
-                assert block_quote_token.bleading_spaces is not None
-                split_spaces = block_quote_token.bleading_spaces.split("\n")
-                grab_bag.indent_already_processed = len(split_spaces[-1])
-            else:
-                assert inner_token.is_list_start
-                list_token = cast(ListStartMarkdownToken, inner_token)
-                grab_bag.indent_already_processed = list_token.indent_level
-        delta = len(grab_bag.extracted_whitespace) - grab_bag.indent_already_processed
-        POGGER.debug("len(ws)=$", len(grab_bag.extracted_whitespace))
-        POGGER.debug("len(containers)=$", grab_bag.indent_already_processed)
-        grab_bag.have_pre_processed_indent = (
-            grab_bag.indent_already_processed != -1 and delta >= 4
-        )
-
-        grab_bag.do_skip_containers_before_leaf_blocks = (
-            grab_bag.have_pre_processed_indent
-        )
-
-    @staticmethod
-    def __handle_leading_whitespace_loop(
-        parser_state: ParserState,
-        i: int,
-        remaining_whitespace: str,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[bool, int, str]:
-        found_stack_index = 0
-        # POGGER.debug(
-        #     "$>remaining_whitespace:$:($)",
-        #     i,
-        #     remaining_whitespace,
-        #     len(remaining_whitespace),
-        # )
-        # POGGER.debug("$>stack:$:", i, parser_state.token_stack[i])
-        # POGGER.debug(
-        #     "$>token:$:", i, parser_state.token_stack[i].matching_markdown_token
-        # )
-        inner_token = parser_state.token_stack[i].matching_markdown_token
-        assert inner_token is not None
-        if inner_token.is_block_quote_start:
-            start_bq_index = remaining_whitespace.find(">")
-            if start_bq_index < 0 or start_bq_index >= 4:
-                # POGGER.debug("1-->$>start_bq_index:$:", i, start_bq_index)
-                # POGGER.debug("$>remaining_whitespace:$:", i, remaining_whitespace)
-                if len(remaining_whitespace) >= 4:
-                    found_stack_index = i
-                return True, found_stack_index, remaining_whitespace
-            raise AssertionError()
-        if not inner_token.is_list_start:
-            # POGGER.debug("2-->")
-            if len(remaining_whitespace) >= 4:
-                found_stack_index = (
-                    i + 1 if parser_state.token_stack[i].is_indented_code_block else i
-                )
-            return True, found_stack_index, remaining_whitespace
-        assert inner_token.is_list_start
-        list_token = cast(ListStartMarkdownToken, inner_token)
-        assert grab_bag.indent_used_by_container >= 0
-        remaining_indent = list_token.indent_level - (
-            grab_bag.indent_already_processed + grab_bag.indent_used_by_container
-        )
-        # POGGER.debug("$>remaining_indent:$:", i, remaining_indent)
-        left_whitespace = remaining_whitespace[:remaining_indent]
-        # POGGER.debug("$>left_whitespace:$:", i, left_whitespace)
-        if len(left_whitespace) < remaining_indent:
-            if len(remaining_whitespace) >= 4:
-                found_stack_index = i
-            # POGGER.debug("3-->")
-            return True, found_stack_index, remaining_whitespace
-        remaining_whitespace = remaining_whitespace[remaining_indent:]
-        grab_bag.indent_already_processed = list_token.indent_level
-        return False, found_stack_index, remaining_whitespace
-
-    @staticmethod
-    def __handle_leading_whitespace(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        leading_whitespace: Optional[str],
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        assert leading_whitespace is not None
-        grab_bag.indent_already_processed, found_stack_index, remaining_whitespace = (
-            0,
-            0,
-            leading_whitespace[:],
-        )
-        POGGER.debug(">remaining_whitespace:$:", remaining_whitespace)
-        for i in range(grab_bag.container_depth + 1, len(parser_state.token_stack)):
-            (
-                do_break,
-                found_stack_index,
-                remaining_whitespace,
-            ) = ContainerBlockProcessor.__handle_leading_whitespace_loop(
-                parser_state,
-                i,
-                remaining_whitespace,
-                grab_bag,
-            )
-            # POGGER.debug(">do_break:$:", do_break)
-            # POGGER.debug(">remaining_whitespace:$:", remaining_whitespace)
-            if do_break:
-                # POGGER.debug(">break!")
-                break
-        POGGER.debug(">stack_index:$:", found_stack_index)
-        if found_stack_index:
-            grab_bag.have_pre_processed_indent = True
-            close_tokens, _ = parser_state.close_open_blocks_fn(
-                parser_state,
-                include_lists=True,
-                include_block_quotes=True,
-                was_forced=True,
-                until_this_index=found_stack_index,
-            )
-            grab_bag.extend_container_tokens(close_tokens)
-            ind = parser_state.find_last_container_on_stack()
-            if parser_state.token_stack[ind].is_list:
-                ind2 = parser_state.find_last_block_quote_on_stack()
-                block_quote_end_index = (
-                    grab_bag.indent_used_by_container + 1 if ind2 else 0
-                )
-                # POGGER.debug(">ind2:$:", ind2)
-                extra_indent = 1 if grab_bag.container_depth else 0
-                list_token = cast(
-                    ListStartMarkdownToken,
-                    parser_state.token_stack[ind].matching_markdown_token,
-                )
-                list_token.add_leading_spaces(
-                    position_marker.text_to_parse[
-                        block_quote_end_index : grab_bag.indent_already_processed
-                        + extra_indent
-                    ]
-                )
-
-            # POGGER.debug(">text_to_parse:$:", position_marker.text_to_parse)
-            # POGGER.debug(
-            #     ">text_to_parse[grab_bag.indent_already_processed:]:$:",
-            #     position_marker.text_to_parse[grab_bag.indent_already_processed:],
-            # )
-
-    @staticmethod
-    def __handle_indented_block_start(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        (
-            grab_bag.can_continue,
-            grab_bag.line_to_parse,
-            grab_bag.start_index,
-            grab_bag.text_removed_by_container,
-            grab_bag.removed_chars_at_start_of_line,
-        ) = (
-            True,
-            position_marker.text_to_parse,
-            position_marker.index_number,
-            "",
-            0,
-        )
-        POGGER.debug("parser_state.token_stack>>$", parser_state.token_stack)
-        is_paragraph_continuation = (
-            parser_state.token_stack and parser_state.token_stack[-1].is_paragraph
-        )
-        list_index = parser_state.find_last_list_block_on_stack()
-        block_index = parser_state.find_last_block_quote_on_stack()
-        POGGER.debug("list_index>>$", list_index)
-        POGGER.debug("block_index>>$", block_index)
-        if is_paragraph_continuation and block_index > list_index:
-            grab_bag.was_paragraph_continuation = True
-        # if is_paragraph_continuation and block_index < list_index:
-        #     grab_bag.was_other_paragraph_continuation = True
-        if (
-            not is_paragraph_continuation
-            and parser_state.token_stack
-            and len(parser_state.token_stack) >= 2
-            and parser_state.token_stack[1].is_block_quote
-        ):
-            x_tokens, _ = parser_state.close_open_blocks_fn(
-                parser_state,
-                include_lists=True,
-                include_block_quotes=True,
-            )
-            # POGGER.debug("x_tokens=:$:", x_tokens)
-            grab_bag.extend_container_tokens(x_tokens)
-
-    @staticmethod
-    def __handle_normal_containers(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        (
-            did_process,
-            avoid_block_starts,
-        ) = ContainerBlockProcessor.__check_for_container_starts(
-            parser_state,
-            position_marker,
-            grab_bag,
-        )
-
-        if grab_bag.requeue_line_info or grab_bag.did_blank:
-            grab_bag.can_continue = False
-            return
-
-        nested_force_list_continuation = ContainerBlockProcessor.__handle_nested_blocks(
-            parser_state,
-            position_marker,
-            did_process,
-            avoid_block_starts,
-            grab_bag,
-        )
-        if grab_bag.do_force_list_continuation:
-            POGGER.debug(
-                "nested_force_list_continuation=$", nested_force_list_continuation
-            )
-            assert not nested_force_list_continuation
-        if grab_bag.can_continue:
-            did_process = ContainerBlockProcessor.__handle_block_continuations(
-                parser_state,
-                position_marker,
-                did_process,
-                grab_bag,
-            )
-
-    @staticmethod
-    def __prepare_container_start_variables(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> PositionMarker:
-        # POGGER.debug("Stack Depth:$:", parser_state.original_stack_depth)
-        # POGGER.debug("Document Depth:$:", parser_state.original_document_depth)
-        if grab_bag.container_depth:
-            return position_marker
-
-        if ParserHelper.tab_character in position_marker.text_to_parse:
-            detabified_line = TabHelper.detabify_string(position_marker.text_to_parse)
-            POGGER.debug("Before tab replacement:$:", position_marker.text_to_parse)
-            POGGER.debug("After tab replacement :$:", detabified_line)
-            position_marker = PositionMarker(
-                position_marker.line_number,
-                position_marker.index_number,
-                detabified_line,
-                position_marker.index_indent,
-            )
-
-        parser_state.mark_start_information(position_marker)
-
-        parser_state.copy_of_token_stack = []
-        parser_state.copy_of_token_stack.extend(parser_state.token_stack)
-
-        parser_state.block_copy = [
-            copy.deepcopy(i.matching_markdown_token)
-            for i in parser_state.token_stack
-            if not i.is_document
-        ]
-
-        return position_marker
-
-    @staticmethod
-    def __prepare_container_start_variables2(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        # Debug to be used for block quotes if needed.
-        # POGGER.debug(
-        #    "Last Block Quote:$:",
-        #    parser_state.last_block_quote_stack_token,
-        # )
-        # POGGER.debug(
-        #    "Last Block Quote:$:",
-        #    parser_state.last_block_quote_markdown_token_index,
-        # )
-        # POGGER.debug(
-        #    "Last Block Quote:$:", parser_state.copy_of_last_block_quote_markdown_token
-        # )
-
-        (
-            new_start_index,
-            grab_bag.extracted_whitespace,
-        ) = ParserHelper.extract_spaces(position_marker.text_to_parse, 0)
-        assert new_start_index is not None
-        grab_bag.start_index = new_start_index
-        ContainerBlockProcessor.__calculate_for_container_blocks(
-            parser_state,
-            grab_bag,
-        )
-
-    @staticmethod
-    def __handle_block_continuations(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        did_process: bool,
-        grab_bag: ContainerGrabBag,
-    ) -> bool:
-        if not did_process:
-            did_process = ContainerBlockProcessor.__process_list_in_progress(
-                parser_state,
-                grab_bag,
-            )
-            if not grab_bag.requeue_line_info:
-                ContainerBlockProcessor.__process_lazy_lines(
-                    parser_state,
-                    position_marker,
-                    grab_bag,
-                )
-        else:
-            is_paragraph_continuation = (
-                parser_state.token_stack and parser_state.token_stack[-1].is_paragraph
-            )
-            list_index = parser_state.find_last_list_block_on_stack()
-            block_index = parser_state.find_last_block_quote_on_stack()
-            # POGGER.debug("is_paragraph_continuation($) and block_index($) > list_index($)",
-            #     is_paragraph_continuation, block_index, list_index)
-            if is_paragraph_continuation and block_index > list_index:
-                grab_bag.was_paragraph_continuation = True
-
-        grab_bag.can_continue = not grab_bag.requeue_line_info
-        return did_process
-
-    @staticmethod
-    def __check_for_container_starts(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[bool, bool]:
-        parser_state.nested_list_start = None
-        ulist_index = -1
-        olist_index = -1
-        (
-            did_process,
-            block_index,
-            avoid_block_starts,
-        ) = ContainerBlockProcessor.__get_block_start_index(
-            parser_state,
-            position_marker,
-            grab_bag,
-        )
-        if grab_bag.can_continue:
-            # POGGER.debug(">>avoid_block_starts>>$", avoid_block_starts)
-            # POGGER.debug(">>did_process>>$", did_process)
-
-            (
-                did_process,
-                ulist_index,
-            ) = ContainerBlockProcessor.__get_list_start_index(
-                parser_state,
-                position_marker,
-                True,
-                did_process,
-                grab_bag,
-            )
-
-        if grab_bag.can_continue:
-            # POGGER.debug("was_container_start>>$", was_container_start)
-            (
-                did_process,
-                olist_index,
-            ) = ContainerBlockProcessor.__get_list_start_index(
-                parser_state,
-                position_marker,
-                False,
-                did_process,
-                grab_bag,
-            )
-
-        grab_bag.end_container_indices = ContainerIndices(
-            block_index=block_index, ulist_index=ulist_index, olist_index=olist_index
-        )
-        return (
-            did_process,
-            avoid_block_starts,
-        )
-
-    @staticmethod
-    def __handle_nested_blocks(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        was_container_start: bool,
-        avoid_block_starts: bool,
-        grab_bag: ContainerGrabBag,
-    ) -> bool:
-        # POGGER.debug("was_container_start>>$", was_container_start)
-
-        grab_bag.last_list_start_index = 0
-        if grab_bag.end_container_indices.block_index != -1:
-            assert grab_bag.last_block_quote_index in (
-                grab_bag.end_container_indices.block_index - 1,
-                grab_bag.end_container_indices.block_index,
-            )
-        elif grab_bag.end_container_indices.olist_index != -1:
-            grab_bag.last_list_start_index = grab_bag.end_container_indices.olist_index
-        elif grab_bag.end_container_indices.ulist_index != -1:
-            grab_bag.last_list_start_index = grab_bag.end_container_indices.ulist_index
-
-        if not parser_state.token_stack[-1].is_fenced_code_block:
-            new_position_marker = PositionMarker(
-                position_marker.line_number,
-                grab_bag.start_index,
-                grab_bag.line_to_parse,
-            )
-            # POGGER.debug("was_container_start>>$", was_container_start)
-            (
-                nested_removed_text,
-                was_indent_text_added,
-                nested_force_list_continuation,
-            ) = ContainerBlockProcessor.__handle_nested_container_blocks(
-                parser_state,
-                new_position_marker,
-                was_container_start,
-                avoid_block_starts,
-                grab_bag,
-            )
-        else:
-            (
-                nested_removed_text,
-                was_indent_text_added,
-                nested_force_list_continuation,
-            ) = (None, False, False)
-
-        POGGER.debug_with_visible_whitespace(
-            "nested_removed_text>>>:$:", nested_removed_text
-        )
-        if nested_removed_text is not None:
-            grab_bag.text_removed_by_container = nested_removed_text
-        grab_bag.can_continue = not (
-            grab_bag.container_depth or grab_bag.did_blank or was_indent_text_added
-        )
-        POGGER.debug(
-            ">>can_continue>>:$: = not(container_depth($) or "
-            + "did_process_blank_line($) or was_indent_text_added($))",
-            grab_bag.can_continue,
-            grab_bag.container_depth,
-            grab_bag.did_blank,
-            was_indent_text_added,
-        )
-        return nested_force_list_continuation
-
-    @staticmethod
-    def __handle_leaf_tokens(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        assert parser_state.original_line_to_parse is not None
-        calculated_indent = len(parser_state.original_line_to_parse) - len(
-            grab_bag.line_to_parse
-        )
-        # POGGER.debug(">>indent>>$", calculated_indent)
-
-        assert not (
-            grab_bag.indent_used_by_list
-            and ">" in grab_bag.indent_used_by_list
-            and parser_state.token_stack[-1].is_paragraph
-            and parser_state.token_stack[-2].is_block_quote
-        )
-
-        # POGGER.debug("ttp>>:$:<", position_marker.text_to_parse)
-        # POGGER.debug("index_number>>:$:<", position_marker.index_number)
-        # POGGER.debug("index_indent>>:$:<", position_marker.index_indent)
-        newer_position_marker = PositionMarker(
-            position_marker.line_number,
-            grab_bag.start_index,
-            grab_bag.line_to_parse,
-            index_indent=calculated_indent,
-        )
-        # POGGER.debug("ttp>>:$:<", newer_position_marker.text_to_parse)
-        # POGGER.debug("index_number>>:$:<", newer_position_marker.index_number)
-        # POGGER.debug("index_indent>>:$:<", newer_position_marker.index_indent)
-        parser_state.mark_for_leaf_processing(grab_bag.container_tokens)
-
-        ContainerBlockLeafProcessor.process_leaf_tokens(
-            parser_state,
-            newer_position_marker,
-            grab_bag,
-        )
-        parser_state.clear_after_leaf_processing()
-
-        grab_bag.extend_container_tokens_with_leaf_tokens()
-
-    @staticmethod
-    def __get_block_start_index(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[bool, int, bool]:
-        POGGER.debug("text_to_parse>$<", position_marker.text_to_parse)
-        POGGER.debug("index_number>$<", position_marker.index_number)
-        POGGER.debug("index_indent>$<", position_marker.index_indent)
-        new_position_marker = PositionMarker(
-            position_marker.line_number,
-            grab_bag.start_index,
-            position_marker.text_to_parse,
-        )
-        POGGER.debug("text_to_parse>$<", new_position_marker.text_to_parse)
-        POGGER.debug("index_number>$<", new_position_marker.index_number)
-        assert grab_bag.container_start_bq_count is not None
-        (
-            did_process,
-            block_index,
-            block_leaf_tokens,
-            block_container_tokens,
-            avoid_block_starts,
-        ) = BlockQuoteProcessor.handle_block_quote_block(
-            parser_state,
-            new_position_marker,
-            grab_bag,
-        )
-        grab_bag.extend_container_tokens(block_container_tokens)
-        grab_bag.extend_leaf_tokens(block_leaf_tokens)
-        # POGGER.debug("did_process>>$", did_process)
-
-        if grab_bag.requeue_line_info:
-            POGGER.debug(">>requeuing lines after looking for block start. returning.")
-
-        if grab_bag.did_blank:
-            POGGER.debug(">>already handled blank line. returning.")
-            grab_bag.extend_container_tokens_with_leaf_tokens()
-
-        grab_bag.can_continue = (
-            not grab_bag.requeue_line_info and not grab_bag.did_blank
-        )
-        return (
-            did_process,
-            block_index,
-            avoid_block_starts,
-        )
-
-    @staticmethod
-    def __get_list_start_index(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        is_ulist: bool,
-        did_process: bool,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[bool, int]:
-        """
-        Note: This is one of the more heavily traffic functions in the
-        parser.  Debugging should be uncommented only if needed.
-        """
-        new_position_marker = PositionMarker(
-            position_marker.line_number, grab_bag.start_index, grab_bag.line_to_parse
-        )
-
-        POGGER.debug(
-            "pre-list>>#$#$#$#",
-            position_marker.index_number,
-            position_marker.index_indent,
-            position_marker.text_to_parse,
-        )
-        POGGER.debug(
-            "pre-list>>#$#$#$#",
-            new_position_marker.index_number,
-            new_position_marker.index_indent,
-            new_position_marker.text_to_parse,
-        )
-        new_list_index = -1
-        if not did_process:
-            assert grab_bag.adj_ws is not None
-            assert grab_bag.extracted_whitespace is not None
-            assert grab_bag.removed_chars_at_start_of_line is not None
-            (
-                did_process,
-                new_list_index,
-                new_line_to_parse,
-                resultant_tokens,
-            ) = ListBlockProcessor.handle_list_block(
-                is_ulist,
-                parser_state,
-                new_position_marker,
-                grab_bag,
-            )
-            # POGGER.debug_with_visible_whitespace("handle_list_block>$", resultant_tokens)
-            if not grab_bag.requeue_line_info:
-                assert new_line_to_parse is not None
-                grab_bag.line_to_parse = new_line_to_parse
-                grab_bag.extend_container_tokens(resultant_tokens)
-        POGGER.debug(
-            "post-ulist>>#$#$#$#",
-            position_marker.index_number,
-            position_marker.index_indent,
-            position_marker.text_to_parse,
-        )
-        POGGER.debug(
-            "post-ulist>>#$#$#$#",
-            new_position_marker.index_number,
-            new_position_marker.index_indent,
-            new_position_marker.text_to_parse,
-        )
-
-        if grab_bag.requeue_line_info:
-            POGGER.debug(
-                ">>requeuing lines after looking for ordered list start. returning."
-            )
-
-        grab_bag.can_continue = not grab_bag.requeue_line_info
-        return (
-            did_process,
-            new_list_index,
-        )
-
-    @staticmethod
-    def __calculate_for_container_blocks(
-        parser_state: ParserState,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        """
-        Perform some calculations that will be needed for parsing the container blocks.
-        """
-        grab_bag.current_container_blocks = [
-            ind for ind in parser_state.token_stack if ind.is_list
-        ]
-        grab_bag.block_quote_data = BlockQuoteData(
-            0
-            if grab_bag.initial_block_quote_count is None
-            else grab_bag.initial_block_quote_count,
-            parser_state.count_of_block_quotes_on_stack(),
-        )
-
-        ContainerBlockProcessor.__calculate_adjusted_whitespace(
-            parser_state,
-            grab_bag,
-        )
-
-    @staticmethod
-    def __look_back_in_document_for_block_quote(
-        parser_state: ParserState, token_index: int
-    ) -> Optional[BlockQuoteMarkdownToken]:
-        # TODO Look back on stack instead?
-        other_block_quote_token, other_token_index = None, token_index
-        while other_token_index >= 0:
-            if parser_state.token_document[other_token_index].is_block_quote_start:
-                block_quote_token = cast(
-                    BlockQuoteMarkdownToken,
-                    parser_state.token_document[other_token_index],
-                )
-                if not ContainerBlockProcessor.__does_block_quote_token_have_end(
-                    parser_state, block_quote_token
-                ):
-                    other_block_quote_token = block_quote_token
-                    break
-            other_token_index -= 1
-        POGGER.debug_with_visible_whitespace(
-            "PLFCB>>other_block_quote_token>>$",
-            other_block_quote_token,
-        )
-        return other_block_quote_token
-
-    @staticmethod
-    def __calculate_adjusted_whitespace_kludge_without_found(
-        parser_state: ParserState, token_index: int, grab_bag: ContainerGrabBag
-    ) -> Tuple[bool, int]:
-        other_block_quote_token = (
-            ContainerBlockProcessor.__look_back_in_document_for_block_quote(
-                parser_state, token_index
-            )
-        )
-
-        # Check to see if out first block token is the same as our first.
-        # if not, do not use it as a base.
-        #
-        # Note; may need to be tweaked for extra levels.
-        if not grab_bag.container_depth and other_block_quote_token:
-            POGGER.debug(
-                "parser_state.token_stack[1]>>:$:", parser_state.token_stack[1]
-            )
-            if (
-                parser_state.token_stack[1].matching_markdown_token
-                != other_block_quote_token
-            ):
-                other_block_quote_token = None
-
-        if other_block_quote_token:
-            POGGER.debug("PLFCB>>other_block_quote_token>>:$:", other_block_quote_token)
-            POGGER.debug(
-                "PLFCB>>other_block_quote_token.leading_text_index>>:$:",
-                other_block_quote_token.leading_text_index,
-            )
-            leading_spaces = other_block_quote_token.calculate_next_bleading_space_part(
-                increment_index=False, delta=-1
-            )
-            POGGER.debug("PLFCB>>leading_spaces>>:$:", leading_spaces)
-            POGGER.debug("PLFCB>>other_block_quote_token>>:$:", other_block_quote_token)
-            POGGER.debug(
-                "PLFCB>>other_block_quote_token.leading_text_index>>:$:",
-                other_block_quote_token.leading_text_index,
-            )
-            force_reline = True
-            old_start_index = len(leading_spaces)
-        else:
-            force_reline = False
-            list_token = cast(
-                ListStartMarkdownToken, parser_state.token_document[token_index]
-            )
-            old_start_index = list_token.indent_level
-        return force_reline, old_start_index
-
-    @staticmethod
-    def __does_block_quote_token_have_end(
-        parser_state: ParserState,
-        found_block_quote_token: Optional[BlockQuoteMarkdownToken],
-    ) -> bool:
-        assert found_block_quote_token
-        POGGER.debug(
-            "PLFCB>>found_block_quote_token>>:$:",
-            ParserHelper.make_value_visible(found_block_quote_token),
-        )
-        found_token_index = parser_state.token_document.index(found_block_quote_token)
-        POGGER.debug("PLFCB>>found_token_index>>:$:", found_token_index)
-        found_token_index += 1
-        while found_token_index < len(parser_state.token_document):
-            if parser_state.token_document[found_token_index].is_end_token:
-                end_token = cast(
-                    EndMarkdownToken, parser_state.token_document[found_token_index]
-                )
-                if end_token.start_markdown_token == found_block_quote_token:
-                    break
-            found_token_index += 1
-        POGGER.debug(
-            "PLFCB>>found_token_index>>:$:max:$",
-            found_token_index,
-            len(parser_state.token_document),
-        )
-        return found_token_index < len(parser_state.token_document)
-
-    @staticmethod
-    def __calculate_adjusted_whitespace_kludge(
-        parser_state: ParserState,
-        token_index: int,
-        found_block_quote_token: Optional[BlockQuoteMarkdownToken],
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        assert grab_bag.extracted_whitespace is not None
-        previous_ws_len = 0
-        force_reline, ws_len = (
-            False,
-            TabHelper.calculate_length(grab_bag.extracted_whitespace) + previous_ws_len,
-        )
-        if (
-            found_block_quote_token
-            and ContainerBlockProcessor.__does_block_quote_token_have_end(
-                parser_state, found_block_quote_token
-            )
-        ):
-            found_block_quote_token = None
-        if found_block_quote_token:
-            POGGER.debug(
-                "PLFCB>>found_block_quote_token>>:$:",
-                ParserHelper.make_value_visible(found_block_quote_token),
-            )
-            leading_spaces = found_block_quote_token.calculate_next_bleading_space_part(
-                increment_index=False, delta=-1, allow_overflow=True
-            )
-            POGGER.debug("PLFCB>>leading_spaces>>:$:", leading_spaces)
-            old_start_index = len(leading_spaces)
-        else:
-            (
-                force_reline,
-                old_start_index,
-            ) = ContainerBlockProcessor.__calculate_adjusted_whitespace_kludge_without_found(
-                parser_state, token_index, grab_bag
-            )
-        POGGER.debug(
-            "old_start_index>>$>>ws_len>>$>>force_reline>>$",
-            old_start_index,
-            ws_len,
-            force_reline,
-        )
-        if force_reline or ws_len >= old_start_index:
-            POGGER.debug("RELINE:$:", grab_bag.line_to_parse)
-            grab_bag.adj_ws = grab_bag.extracted_whitespace[old_start_index:]
-            POGGER.debug(
-                "adj_ws:$: old_start_index:$:", grab_bag.adj_ws, old_start_index
-            )
-
-    @staticmethod
-    def __look_for_any_list_start(
-        parser_state: ParserState,
-    ) -> Tuple[int, Optional[BlockQuoteMarkdownToken]]:
-        found_block_quote_token: Optional[BlockQuoteMarkdownToken] = None
-        token_index = len(parser_state.token_document) - 1
-        while token_index >= 0 and not (
-            parser_state.token_document[token_index].is_any_list_token
-        ):
-            if (
-                not found_block_quote_token
-                and parser_state.token_document[token_index].is_block_quote_start
-            ):
-                found_block_quote_token = cast(
-                    BlockQuoteMarkdownToken,
-                    parser_state.token_document[token_index],
-                )
-            token_index -= 1
-        POGGER.debug(
-            "PLFCB>>Started list-last token>>$",
-            parser_state.token_document[token_index],
-        )
-
-        POGGER.debug(
-            "CAW>>found_block_quote_token>>:$:",
-            ParserHelper.make_value_visible(found_block_quote_token),
-        )
-        if found_block_quote_token:
-            POGGER.debug(
-                "PLFCB>>leading_text_index>>$",
-                found_block_quote_token.leading_text_index,
-            )
-        assert token_index >= 0
-        return token_index, found_block_quote_token
-
-    @staticmethod
-    def __calculate_adjusted_whitespace(
-        parser_state: ParserState,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        """
-        Based on the last container on the stack, determine what the adjusted whitespace is.
-        """
-
-        grab_bag.adj_ws = grab_bag.extracted_whitespace
-        assert grab_bag.adj_ws is not None
-
-        last_block_stack_index = parser_state.find_last_list_block_on_stack()
-        if last_block_stack_index <= 0:
-            assert not grab_bag.current_container_blocks
-            POGGER.debug("PLFCB>>No Started lists")
-            if grab_bag.adjusted_block_index is None:
-                POGGER.debug("PLFCB>>No Started Block Quote")
-            else:
-                POGGER.debug("PLFCB>>Started Block Quote")
-                assert grab_bag.extracted_whitespace is not None
-                grab_bag.adj_ws = grab_bag.extracted_whitespace[
-                    grab_bag.adjusted_block_index :
-                ]
-        else:
-            assert grab_bag.current_container_blocks
-            POGGER.debug(
-                "PLFCB>>Started list-last stack>>$",
-                parser_state.token_stack,
-            )
-            POGGER.debug(
-                "PLFCB>>Started list-last stack>>$",
-                parser_state.token_stack[last_block_stack_index],
-            )
-
-            (
-                token_index,
-                found_block_quote_token,
-            ) = ContainerBlockProcessor.__look_for_any_list_start(parser_state)
-
-            assert grab_bag.adj_ws is not None
-            ContainerBlockProcessor.__calculate_adjusted_whitespace_kludge(
-                parser_state,
-                token_index,
-                found_block_quote_token,
-                grab_bag,
-            )
-            assert grab_bag.adj_ws is not None
-
-    @staticmethod
-    def __handle_nested_container_blocks(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        was_container_start: bool,
-        avoid_block_starts: bool,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[Optional[str], bool, bool]:
-        """
-        Handle the processing of nested container blocks, as they can contain
-        themselves and get somewhat messy.
-        """
-        adjusted_text_to_parse = position_marker.text_to_parse
-
-        POGGER.debug("adjusted_text_to_parse>$<", adjusted_text_to_parse)
-        POGGER.debug("index_number>$<", position_marker.index_number)
-        POGGER.debug("index_indent>$<", position_marker.index_indent)
-        POGGER.debug("parser_state.nested_list_start>$", parser_state.nested_list_start)
-        POGGER.debug("was_container_start>$", was_container_start)
-
-        if was_container_start and position_marker.text_to_parse:
-            assert grab_bag.container_depth < 10
-            nested_container_starts = (
-                ContainerBlockProcessor.__get_nested_container_starts(
-                    parser_state,
-                    position_marker.text_to_parse,
-                    avoid_block_starts,
-                )
-            )
-            POGGER.debug(
-                "__handle_nested_container_blocks>nested_container_starts>>:$:<<",
-                nested_container_starts,
-            )
-
-            grab_bag.adj_line_to_parse = position_marker.text_to_parse
-
-            (
-                indent_level_delta,
-                already_adjusted,
-                active_container_index,
-            ) = ContainerBlockProcessor.__check_for_nested_list_start(
-                parser_state,
-                nested_container_starts,
-                grab_bag,
-            )
-
-            assert grab_bag.is_leaf_tokens_empty()
-            adjusted_text_to_parse = ContainerBlockProcessor.__do_nested_cleanup(
-                parser_state,
-                indent_level_delta,
-                already_adjusted,
-                active_container_index,
-                adjusted_text_to_parse,
-                grab_bag,
-            )
-            # POGGER.debug_with_visible_whitespace("adjusted_text_to_parse>>$>>", adjusted_text_to_parse)
-
-            (
-                adjusted_text_to_parse,
-                nested_removed_text,
-                was_indent_text_added,
-                inner_force_list_continuation,
-            ) = ContainerBlockProcessor.__check_for_next_container(
-                parser_state,
-                position_marker,
-                nested_container_starts,
-                adjusted_text_to_parse,
-                grab_bag,
-            )
-        else:
-            (
-                nested_removed_text,
-                was_indent_text_added,
-                inner_force_list_continuation,
-            ) = (
-                None,
-                False,
-                False,
-            )
-
-        # POGGER.debug_with_visible_whitespace("adjusted_text_to_parse>>$>>", adjusted_text_to_parse)
-        grab_bag.line_to_parse = adjusted_text_to_parse
-        return (
-            nested_removed_text,
-            was_indent_text_added,
-            inner_force_list_continuation,
-        )
-
-    @staticmethod
-    def __check_for_nested_list_start(
-        parser_state: ParserState,
-        nested_container_starts: ContainerIndices,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[int, bool, int]:
-        active_container_index = max(
-            grab_bag.end_container_indices.ulist_index,
-            grab_bag.end_container_indices.olist_index,
-            grab_bag.end_container_indices.block_index,
-        )
-        POGGER.debug(
-            "check next container_start>max>>$>>bq>>$",
-            active_container_index,
-            grab_bag.end_container_indices.block_index,
-        )
-        indent_level_delta, already_adjusted = 0, False
-        if (
-            grab_bag.end_container_indices.block_index != -1
-            and not nested_container_starts.ulist_index
-            and not nested_container_starts.olist_index
-        ):
-            assert active_container_index == grab_bag.end_container_indices.block_index
-            POGGER.debug(
-                "parser_state.nested_list_start>>$<<",
-                parser_state.nested_list_start,
-            )
-            POGGER.debug(
-                "parser_state.token_document>>$<<", parser_state.token_document
-            )
-            if parser_state.nested_list_start and grab_bag.adj_line_to_parse.strip():
-                (
-                    grab_bag.start_index,
-                    indent_level,
-                    indent_was_adjusted,
-                    indent_level_delta,
-                ) = ContainerBlockProcessor.__calculate_initial_list_adjustments(
-                    parser_state,
-                    grab_bag.adj_line_to_parse,
-                    grab_bag.end_container_indices,
-                )
-                already_adjusted = ContainerBlockProcessor.__adjust_line_2(
-                    parser_state,
-                    indent_level,
-                    nested_container_starts,
-                    indent_was_adjusted,
-                    grab_bag,
-                )
-        return (
-            indent_level_delta,
-            already_adjusted,
-            active_container_index,
-        )
-
-    @staticmethod
-    def __calculate_initial_list_adjustments(
-        parser_state: ParserState,
-        adj_line_to_parse: str,
-        end_container_indices: ContainerIndices,
-    ) -> Tuple[int, int, bool, int]:
-        start_index, _ = ParserHelper.extract_spaces(adj_line_to_parse, 0)
-        assert start_index is not None
-        POGGER.debug("start_index>>$<<", start_index)
-
-        assert parser_state.nested_list_start is not None
-        assert parser_state.nested_list_start.matching_markdown_token is not None
-        POGGER.debug(
-            "parser_state.nested_list_start.matching_markdown_token>>$<<",
-            parser_state.nested_list_start.matching_markdown_token,
-        )
-        list_start_token_index = parser_state.token_document.index(
-            parser_state.nested_list_start.matching_markdown_token
-        )
-        POGGER.debug(
-            "list_start_token_index>>$<<",
-            list_start_token_index,
-        )
-        if list_start_token_index < (len(parser_state.token_document) - 1):
-            token_after_list_start = parser_state.token_document[
-                list_start_token_index + 1
-            ]
-            POGGER.debug(
-                "token_after_list_start>>$<<",
-                token_after_list_start,
-            )
-            assert (
-                parser_state.nested_list_start.matching_markdown_token.line_number
-                == token_after_list_start.line_number
-            )
-            column_number_delta = (
-                token_after_list_start.column_number
-                - parser_state.nested_list_start.matching_markdown_token.column_number
-            )
-        else:
-            column_number_delta = 0
-        POGGER.debug(
-            "column_number_delta>>$<<",
-            column_number_delta,
-        )
-        indent_level_delta, indent_level, adjusted_indent_level = (
-            0,
-            parser_state.nested_list_start.indent_level,
-            column_number_delta + end_container_indices.block_index,
-        )
-        POGGER.debug(
-            "adjusted_indent_level>>$<<  indent_level>$",
-            adjusted_indent_level,
-            indent_level,
-        )
-        indent_was_adjusted = indent_level != adjusted_indent_level
-        if indent_level > adjusted_indent_level:
-            indent_level_delta = indent_level - adjusted_indent_level
-        indent_level = column_number_delta + end_container_indices.block_index
-
-        return start_index, indent_level, indent_was_adjusted, indent_level_delta
-
-    @staticmethod
-    def __adjust_line_2(
-        parser_state: ParserState,
-        indent_level: int,
-        nested_container_starts: ContainerIndices,
-        indent_was_adjusted: bool,
-        grab_bag: ContainerGrabBag,
-    ) -> bool:
-        if (
-            parser_state.token_document[-1].is_blank_line
-            and (grab_bag.end_container_indices.block_index + grab_bag.start_index)
-            < indent_level
-        ):
-            POGGER.debug("\n\nBOOM\n\n")
-
-            y_tokens = []
-            while parser_state.token_document[-1].is_blank_line:
-                y_tokens.append(parser_state.token_document[-1])
-                del parser_state.token_document[-1]
-
-            x_tokens, _ = parser_state.close_open_blocks_fn(
-                parser_state,
-                include_lists=True,
-            )
-            parser_state.token_document.extend(x_tokens)
-            parser_state.token_document.extend(y_tokens)
-        elif (
-            not nested_container_starts.block_index
-            and grab_bag.adj_line_to_parse
-            and grab_bag.adj_line_to_parse[0] == ParserHelper.space_character
-            and indent_was_adjusted
-            and parser_state.nested_list_start
-        ):
-            assert parser_state.nested_list_start is not None
-        return False
-
-    # pylint: disable=too-many-arguments
-    @staticmethod
-    def __do_nested_cleanup(
-        parser_state: ParserState,
-        delta: int,
-        already_adjusted: bool,
-        active_container_index: int,
-        adjusted_text_to_parse: str,
-        grab_bag: ContainerGrabBag,
-    ) -> str:
-        if delta or already_adjusted:
-            adjusted_text_to_parse = grab_bag.adj_line_to_parse
-        else:
-            POGGER.debug("active_container_index<<$<<", active_container_index)
-            adjustment_filler = ParserHelper.repeat_string(
-                ParserHelper.space_character, active_container_index
-            )
-            grab_bag.adj_line_to_parse = (
-                f"{adjustment_filler}{grab_bag.adj_line_to_parse}"
-            )
-
-        parser_state.token_document.extend(grab_bag.container_tokens)
-        grab_bag.clear_container_tokens()
-        return adjusted_text_to_parse
-
-    # pylint: enable=too-many-arguments
-
-    @staticmethod
-    def __check_for_next_container(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        nested_container_starts: ContainerIndices,
-        adjusted_text_to_parse: str,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[str, Optional[str], bool, bool]:
-        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
-        POGGER.debug(
-            "check next container_start>tokenized_document>>$",
-            parser_state.token_document,
-        )
-
-        if (
-            nested_container_starts.ulist_index
-            or nested_container_starts.olist_index
-            or nested_container_starts.block_index
-        ):
-            POGGER.debug(
-                "check next container_start>nested_container",
-            )
-            (
-                adjusted_text_to_parse,
-                nested_removed_text,
-                was_indent_text_added,
-                inner_force_list_continuation,
-            ) = ContainerBlockProcessor.__look_for_container_blocks(
-                parser_state,
-                position_marker,
-                grab_bag,
-            )
-        else:
-            (
-                nested_removed_text,
-                was_indent_text_added,
-                inner_force_list_continuation,
-            ) = (None, False, False)
-        parser_state.set_no_para_start_if_empty()
-
-        return (
-            adjusted_text_to_parse,
-            nested_removed_text,
-            was_indent_text_added,
-            inner_force_list_continuation,
-        )
-
-    @staticmethod
-    def __get_nested_container_starts(
-        parser_state: ParserState,
-        line_to_parse: str,
-        avoid_block_starts: bool,
-    ) -> ContainerIndices:
-        POGGER.debug(
-            "__handle_nested_container_blocks>stack>>:$:<<",
-            line_to_parse,
-        )
-
-        POGGER.debug("check next container_start>")
-        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
-
-        _, ex_ws_test = ParserHelper.extract_spaces(line_to_parse, 0)
-        assert ex_ws_test is not None
-
-        whitespace_scan_start_index = 0
-        for token_stack_item in parser_state.token_stack:
-            if token_stack_item.is_list:
-                list_stack_token = cast(ListStackToken, token_stack_item)
-                if list_stack_token.ws_before_marker <= len(ex_ws_test):
-                    whitespace_scan_start_index = list_stack_token.ws_before_marker
-
-        after_ws_index, ex_whitespace = ParserHelper.extract_spaces(
-            line_to_parse, whitespace_scan_start_index
-        )
-        if not ex_whitespace:
-            ex_whitespace = ""
-            after_ws_index = whitespace_scan_start_index
-
-        assert after_ws_index is not None
-
-        nested_ulist_start, _, _, _ = ListBlockProcessor.is_ulist_start(
-            parser_state, line_to_parse, after_ws_index, ex_whitespace, False
-        )
-        nested_olist_start, _, _, _ = ListBlockProcessor.is_olist_start(
-            parser_state, line_to_parse, after_ws_index, ex_whitespace, False
-        )
-        nested_block_start = (
-            False
-            if avoid_block_starts
-            else BlockQuoteProcessor.is_block_quote_start(
-                line_to_parse, after_ws_index, ex_whitespace
-            )
-        )
-
-        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
-
-        return ContainerIndices(
-            nested_ulist_start, nested_olist_start, nested_block_start
-        )
-
-    @staticmethod
-    def __calculate_nested_removed_text(
-        parser_state: ParserState,
-        previous_document_length: int,
-        grab_bag: ContainerGrabBag,
-    ) -> Optional[str]:
-        nested_removed_text = None
-        POGGER.debug("__calculate_nested_removed_text")
-        POGGER.debug(
-            "__cnrt->token_doc($)",
-            ParserHelper.make_value_visible(parser_state.token_document),
-        )
-        if previous_document_length != len(parser_state.token_document):
-            POGGER.debug(
-                "\ncheck next container_start>added tokens:$:",
-                parser_state.token_document[previous_document_length:],
-            )
-            if parser_state.token_document[-1].is_block_quote_start:
-                block_quote_token = cast(
-                    BlockQuoteMarkdownToken, parser_state.token_document[-1]
-                )
-                nested_removed_text = (
-                    ContainerBlockProcessor.__calculate_nested_removed_text_block_quote(
-                        parser_state, block_quote_token, grab_bag
-                    )
-                )
-        if not nested_removed_text:
-            POGGER.debug("__cnrt:nested_removed_text:$:", nested_removed_text)
-            last_container_index = parser_state.find_last_container_on_stack()
-            if (
-                last_container_index > 0
-                and parser_state.token_stack[last_container_index].is_block_quote
-            ):
-                block_quote_token = cast(
-                    BlockQuoteMarkdownToken,
-                    parser_state.token_stack[
-                        last_container_index
-                    ].matching_markdown_token,
-                )
-                assert block_quote_token.bleading_spaces is not None
-                split_spaces = block_quote_token.bleading_spaces.split(
-                    ParserHelper.newline_character
-                )
-                nested_removed_text = str(split_spaces[-1])
-        POGGER.debug("__calculate_nested_removed_text<<:$:", nested_removed_text)
-        return nested_removed_text
-
-    @staticmethod
-    def __calculate_nested_removed_text_block_quote(
-        parser_state: ParserState,
-        block_quote_token: BlockQuoteMarkdownToken,
-        grab_bag: ContainerGrabBag,
-    ) -> str:
-        assert block_quote_token.bleading_spaces is not None
-        split_spaces = block_quote_token.bleading_spaces.split(
-            ParserHelper.newline_character
-        )
-        nested_removed_text = str(split_spaces[-1])
-        POGGER.debug("nested_removed_text:$:", nested_removed_text)
-        if (
-            len(parser_state.token_document) > 1
-            and parser_state.token_document[-2].is_new_list_item
-            and parser_state.token_document[-2].line_number
-            == parser_state.token_document[-1].line_number
-        ):
-            column_number_delta = (
-                parser_state.token_document[-1].column_number
-                - parser_state.token_document[-2].column_number
-            )
-            block_quote_character_index = nested_removed_text.index(">")
-            nested_removed_text_length = len(nested_removed_text)
-            POGGER.debug(
-                "column_number_delta=$, block_quote_character_index=$, nested_removed_text_length=$",
-                column_number_delta,
-                block_quote_character_index,
-                nested_removed_text_length,
-            )
-            adjusted_length = (
-                parser_state.token_document[-2].column_number
-                - 1
-                + column_number_delta
-                + (nested_removed_text_length - block_quote_character_index)
-            )
-            POGGER.debug("adjusted_length=$", adjusted_length)
-            if adjusted_length != nested_removed_text_length:
-                assert parser_state.original_line_to_parse
-                nested_removed_text = parser_state.original_line_to_parse[
-                    :adjusted_length
-                ]
-                POGGER.debug("previous:$:", nested_removed_text)
-                grab_bag.weird_adjusted_text = nested_removed_text
-        return nested_removed_text
-
-    @staticmethod
-    def __look_for_container_blocks(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> Tuple[str, Optional[str], bool, bool]:
-        """
-        Look for container blocks that we can use.
-        """
-        POGGER.debug("check next container_start>recursing")
-        adj_block, position_marker = (
-            None
-            if grab_bag.end_container_indices.block_index == -1
-            else grab_bag.end_container_indices.block_index,
-            PositionMarker(position_marker.line_number, -1, grab_bag.adj_line_to_parse),
-        )
-        new_container_depth = grab_bag.container_depth + 1
-
-        POGGER.debug(
-            "position_marker>:$:$:",
-            position_marker.index_number,
-            position_marker.text_to_parse,
-        )
-        POGGER.debug("adj_block>:$:", adj_block)
-        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,
-            adjusted_text_to_parse,
-            current_bq_count_increment,
-            grab_bag.requeue_line_info,
-            grab_bag.did_blank,
-            inner_force_list_continuation,
-        ) = ContainerBlockProcessor.parse_line_for_container_blocks(
-            parser_state,
-            position_marker,
-            False,
-            grab_bag.parser_properties,
-            grab_bag.block_quote_data.current_count,
-            container_depth=new_container_depth,
-            adjusted_block_index=adj_block,
-            initial_block_quote_count=grab_bag.block_quote_data.current_count,
-            original_line=grab_bag.original_line,
-        )
-        assert (
-            not grab_bag.requeue_line_info
-            or not grab_bag.requeue_line_info.lines_to_requeue
-        )
-        assert adjusted_text_to_parse is not None
-
-        POGGER.debug("\nRECURSED\n\n")
-
-        # POGGER.debug("previous_document_length=$", previous_document_length)
-        nested_removed_text = ContainerBlockProcessor.__calculate_nested_removed_text(
-            parser_state, previous_document_length, grab_bag
-        )
-        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
-        POGGER.debug(
-            "check next container_start>tokenized_document>>$",
-            parser_state.token_document,
-        )
-        POGGER.debug("check next container_start>line_parse>>$", adjusted_text_to_parse)
-        if current_bq_count_increment:
-            grab_bag.block_quote_data = BlockQuoteData(
-                grab_bag.block_quote_data.current_count + current_bq_count_increment,
-                parser_state.count_of_block_quotes_on_stack(),
-            )
-
-        POGGER.debug("produced_inner_tokens=$", produced_inner_tokens)
-        was_indent_text_added = bool(
-            parser_state.token_stack[-1].is_indented_code_block
-            and produced_inner_tokens
-            and len(produced_inner_tokens) == 1
-            and produced_inner_tokens[0].is_text
-        )
-        POGGER.debug("was_indent_text_added=$", was_indent_text_added)
-
-        # 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)
-
-        return (
-            adjusted_text_to_parse,
-            nested_removed_text,
-            was_indent_text_added,
-            inner_force_list_continuation,
-        )
-
-    @staticmethod
-    def __process_list_in_progress(
-        parser_state: ParserState,
-        grab_bag: ContainerGrabBag,
-    ) -> bool:
-        did_process, ind = LeafBlockProcessorParagraph.check_for_list_in_process(
-            parser_state
-        )
-        if did_process:
-            assert not grab_bag.container_tokens
-            POGGER.debug("clt>>list-in-progress")
-            resultant_tokens = ListBlockProcessor.list_in_process(
-                parser_state,
-                ind,
-                grab_bag,
-            )
-            grab_bag.extend_container_tokens(resultant_tokens)
-
-        return did_process
-
-    @staticmethod
-    def __process_lazy_lines(
-        parser_state: ParserState,
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> None:
-        assert grab_bag.is_leaf_tokens_empty()
-        POGGER.debug("clt>>lazy-check")
-
-        after_ws_index, ex_whitespace = ParserHelper.extract_spaces(
-            grab_bag.line_to_parse, 0
-        )
-        remaining_line = grab_bag.line_to_parse[after_ws_index:]
-        POGGER.debug("__process_lazy_lines>>mod->ltp>$<", remaining_line)
-        POGGER.debug("__process_lazy_lines>>mod->ews>$<", ex_whitespace)
-
-        (
-            lazy_tokens,
-            grab_bag.block_quote_data,
-            grab_bag.was_paragraph_continuation,
-        ) = BlockQuoteProcessor.check_for_lazy_handling(
-            parser_state,
-            position_marker,
-            grab_bag.block_quote_data,
-            remaining_line,
-            ex_whitespace,
-            grab_bag.was_paragraph_continuation,
-        )
-        grab_bag.extend_container_tokens(lazy_tokens)
-
-    @staticmethod
-    def __look_for_pragmas(
-        position_marker: PositionMarker,
-        grab_bag: ContainerGrabBag,
-    ) -> bool:
-        _, pragma_whitespace = ParserHelper.extract_spaces(
-            position_marker.text_to_parse, 0
-        )
-        return (
-            PragmaExtension.look_for_pragmas(
-                position_marker,
-                position_marker.text_to_parse,
-                grab_bag.container_depth,
-                pragma_whitespace,
-                grab_bag.parser_properties,
-            )
-            if grab_bag.parser_properties.is_pragmas_enabled
-            else False
-        )
-
-
-# pylint: enable=too-few-public-methods
diff --git a/pymarkdown/container_block_leaf_processor.py b/pymarkdown/container_blocks/container_block_leaf_processor.py
similarity index 87%
rename from pymarkdown/container_block_leaf_processor.py
rename to pymarkdown/container_blocks/container_block_leaf_processor.py
index 7e121f49..64dd456a 100644
--- a/pymarkdown/container_block_leaf_processor.py
+++ b/pymarkdown/container_blocks/container_block_leaf_processor.py
@@ -7,7 +7,7 @@ import logging
 from typing import List, Optional, Tuple, cast
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
 from pymarkdown.container_markdown_token import (
     BlockQuoteMarkdownToken,
     ListStartMarkdownToken,
@@ -47,7 +47,52 @@ class ContainerBlockLeafProcessor:
     """
 
     @staticmethod
-    def process_leaf_tokens(
+    def handle_leaf_tokens(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        """
+        Handle the handoff between processing containers and the leaf tokens.
+        """
+        assert parser_state.original_line_to_parse is not None
+        calculated_indent = len(parser_state.original_line_to_parse) - len(
+            grab_bag.line_to_parse
+        )
+        # POGGER.debug(">>indent>>$", calculated_indent)
+
+        assert not (
+            grab_bag.indent_used_by_list
+            and ">" in grab_bag.indent_used_by_list
+            and parser_state.token_stack[-1].is_paragraph
+            and parser_state.token_stack[-2].is_block_quote
+        )
+
+        # POGGER.debug("ttp>>:$:<", position_marker.text_to_parse)
+        # POGGER.debug("index_number>>:$:<", position_marker.index_number)
+        # POGGER.debug("index_indent>>:$:<", position_marker.index_indent)
+        newer_position_marker = PositionMarker(
+            position_marker.line_number,
+            grab_bag.start_index,
+            grab_bag.line_to_parse,
+            index_indent=calculated_indent,
+        )
+        # POGGER.debug("ttp>>:$:<", newer_position_marker.text_to_parse)
+        # POGGER.debug("index_number>>:$:<", newer_position_marker.index_number)
+        # POGGER.debug("index_indent>>:$:<", newer_position_marker.index_indent)
+        parser_state.mark_for_leaf_processing(grab_bag.container_tokens)
+
+        ContainerBlockLeafProcessor.__process_leaf_tokens(
+            parser_state,
+            newer_position_marker,
+            grab_bag,
+        )
+        parser_state.clear_after_leaf_processing()
+
+        grab_bag.extend_container_tokens_with_leaf_tokens()
+
+    @staticmethod
+    def __process_leaf_tokens(
         parser_state: ParserState,
         xposition_marker: PositionMarker,
         grab_bag: ContainerGrabBag,
@@ -64,38 +109,16 @@ class ContainerBlockLeafProcessor:
             index_indent=xposition_marker.index_indent,
         )
 
-        # POGGER.debug("ttp>>:$:<", position_marker.text_to_parse)
-        # POGGER.debug("index_number>>:$:<", position_marker.index_number)
-        # POGGER.debug("index_indent>>:$:<", position_marker.index_indent)
-
         (
             new_index_number,
             extracted_leaf_whitespace,
         ) = ParserHelper.extract_spaces(position_marker.text_to_parse, 0)
-        # POGGER.debug("new_index_number>>:$:<", new_index_number)
-        # POGGER.debug("extracted_leaf_whitespace>>:$:<", extracted_leaf_whitespace)
         assert new_index_number is not None
 
         total_ws = new_index_number + position_marker.index_indent
-        # POGGER.debug(
-        #     "total_ws=$ = new_index_number=$ + index_indent=$",
-        #     total_ws,
-        #     new_index_number,
-        #     position_marker.index_indent,
-        # )
 
         last_block_index = parser_state.find_last_block_quote_on_stack()
         last_list_index = parser_state.find_last_list_block_on_stack()
-        # POGGER.debug("last_block_index>>:$:<", last_block_index)
-        # POGGER.debug(
-        #     "last_block.token>>:$:<",
-        #     parser_state.token_stack[last_block_index].matching_markdown_token,
-        # )
-        # POGGER.debug("last_list_index>>:$:<", last_list_index)
-        # POGGER.debug(
-        #     "last_list.token>>:$:<",
-        #     parser_state.token_stack[last_list_index].matching_markdown_token,
-        # )
 
         ContainerBlockLeafProcessor.__handle_special_block_quote_reduction(
             parser_state,
@@ -130,12 +153,6 @@ class ContainerBlockLeafProcessor:
             grab_bag,
         )
 
-        # POGGER.debug(
-        #     "position_marker($:$)>>$",
-        #     position_marker.index_number,
-        #     position_marker.index_indent,
-        #     position_marker.text_to_parse,
-        # )
         if (
             grab_bag.is_leaf_tokens_empty()
             and not grab_bag.do_skip_containers_before_leaf_blocks
@@ -152,25 +169,6 @@ class ContainerBlockLeafProcessor:
                 )
             )
 
-        # POGGER.debug(
-        #     "parsing leaf($:$)>>$",
-        #     position_marker.index_number,
-        #     position_marker.index_indent,
-        #     position_marker.text_to_parse,
-        # )
-        # POGGER.debug("actual_removed_leading_space>>:$:",actual_removed_leading_space)
-        # POGGER.debug(
-        #     "original_line_to_parse>>:$:<", parser_state.original_line_to_parse
-        # )
-        # xx = parser_state.original_line_to_parse[position_marker.index_indent:]
-        # xy = position_marker.text_to_parse[position_marker.index_number:]
-        # POGGER.debug("xx>>:$:",xx)
-        # POGGER.debug("xy>>:$:",xy)
-        # assert xx == xy
-
-        # POGGER.debug(
-        #     ">>orig_text_removed_by_container>>:$:<<", orig_text_removed_by_container
-        # )
         ContainerBlockLeafProcessor.__parse_line_for_leaf_blocks(
             parser_state,
             position_marker,
@@ -424,9 +422,6 @@ class ContainerBlockLeafProcessor:
         POGGER.debug("yes adjust_for_list_container")
         removed_leading_space = None
         actual_removed_leading_space = None
-        # POGGER.debug("line_number>>:$:<", xposition_marker.line_number)
-        # POGGER.debug("column_number>>:$:<", xposition_marker.index_number)
-        # POGGER.debug("found_list_token>>:$:<", found_list_token)
 
         found_list_token = ContainerBlockLeafProcessor.__adjust_for_list_container_find(
             parser_state, xposition_marker
@@ -437,44 +432,17 @@ class ContainerBlockLeafProcessor:
                 parser_state.token_stack[last_list_index].matching_markdown_token,
             )
             calc_indent_level = list_token.indent_level
-            # POGGER.debug("calc_indent_level>>:$:<", calc_indent_level)
             if grab_bag.text_removed_by_container:
                 calc_indent_level -= len(grab_bag.text_removed_by_container)
-                # POGGER.debug("calc_indent_level>>:$:<", calc_indent_level)
-            # POGGER.debug("extracted_leaf_whitespace>>:$:<", extracted_leaf_whitespace)
             if len(extracted_leaf_whitespace) > calc_indent_level:
                 extracted_leaf_whitespace = extracted_leaf_whitespace[
                     :calc_indent_level
                 ]
-                # POGGER.debug("extracted_leaf_whitespace>>:$:<", extracted_leaf_whitespace)
-            # POGGER.debug(
-            #     "parser_state.token_document>>$", parser_state.token_document
-            # )
-
-            # POGGER.debug(
-            #     "plt-b>>last_block_token>>$",
-            #     parser_state.token_stack[last_list_index].matching_markdown_token,
-            # )
             list_token.add_leading_spaces(extracted_leaf_whitespace)
             actual_removed_leading_space = extracted_leaf_whitespace
 
-            # POGGER.debug(
-            #     "xposition_marker($:$)>>$",
-            #     xposition_marker.index_number,
-            #     xposition_marker.index_indent,
-            #     xposition_marker.text_to_parse,
-            # )
-            # POGGER.debug("orig:$:", parser_state.original_line_to_parse)
-
             if not grab_bag.container_depth and not xposition_marker.index_indent:
                 removed_leading_space = extracted_leaf_whitespace
-            # POGGER.debug(
-            #     "plt-b>>last_block_token>>$",
-            #     parser_state.token_stack[last_list_index].matching_markdown_token,
-            # )
-            # POGGER.debug(
-            #     "parser_state.token_document>>$", parser_state.token_document
-            # )
         return list_token, removed_leading_space, actual_removed_leading_space
 
     # pylint: disable=too-many-arguments
@@ -514,19 +482,12 @@ class ContainerBlockLeafProcessor:
             POGGER.debug("not adjust_for_list_container")
         # pylint: enable=chained-comparison
         if removed_leading_space:
-            # POGGER.debug("removed_leading_space:$:", removed_leading_space)
             xposition_marker = PositionMarker(
                 xposition_marker.line_number,
                 len(removed_leading_space),
                 xposition_marker.text_to_parse,
                 index_indent=xposition_marker.index_indent,
             )
-        # POGGER.debug("removed_leading_space:$:", removed_leading_space)
-        # POGGER.debug("actual_removed_leading_space:$:", actual_removed_leading_space)
-        # POGGER.debug("list_token:$:", list_token)
-        # POGGER.debug("grab_bag.is_para_continue:$:", grab_bag.is_para_continue)
-        # POGGER.debug("grab_bag.text_removed_by_container:$:", grab_bag.text_removed_by_container)
-        # POGGER.debug("xposition_marker($:$):$:", xposition_marker.index_number, xposition_marker.index_indent, xposition_marker.text_to_parse)
         # pylint: disable=too-many-boolean-expressions
         if (
             removed_leading_space is None
@@ -541,8 +502,6 @@ class ContainerBlockLeafProcessor:
             total_removed = len(grab_bag.text_removed_by_container) + len(
                 actual_removed_leading_space
             )
-            # POGGER.debug("total_removed:$:", total_removed)
-            # POGGER.debug("indent_level:$:", list_token.indent_level)
             delta = list_token.indent_level - total_removed
             # assert t1 >= list_token.indent_level
             xposition_marker = PositionMarker(
@@ -551,7 +510,6 @@ class ContainerBlockLeafProcessor:
                 xposition_marker.text_to_parse[delta:],
                 xposition_marker.index_indent,
             )
-            # POGGER.debug("xposition_marker($:$):$:", xposition_marker.index_number, xposition_marker.index_indent, xposition_marker.text_to_parse)
         # pylint: enable=too-many-boolean-expressions
         return removed_leading_space, actual_removed_leading_space, xposition_marker
 
@@ -587,15 +545,6 @@ class ContainerBlockLeafProcessor:
         actual_removed_leading_space: Optional[str],
         grab_bag: ContainerGrabBag,
     ) -> Tuple[str, int, Optional[PositionMarker]]:
-        # POGGER.debug(
-        #     "xposition_marker.text_to_parse=$", xposition_marker.text_to_parse
-        # )
-        # POGGER.debug(
-        #     "xposition_marker.index_number=$", xposition_marker.index_number
-        # )
-        # POGGER.debug(
-        #     "xposition_marker.index_indent=$", xposition_marker.index_indent
-        # )
         if grab_bag.do_force_list_continuation:
             POGGER.debug(
                 "actual_removed_leading_space=$=", actual_removed_leading_space
@@ -637,9 +586,6 @@ class ContainerBlockLeafProcessor:
             current_indent_level,
             grab_bag,
         )
-        # POGGER.debug(
-        #     "original_line_to_parse>>:$:<", parser_state.original_line_to_parse
-        # )
         ContainerBlockLeafProcessor.__val(parser_state, new_text_to_parse)
         return new_text_to_parse, new_index_indent, None
 
diff --git a/pymarkdown/container_blocks/container_block_nested_processor.py b/pymarkdown/container_blocks/container_block_nested_processor.py
new file mode 100644
index 00000000..f4a68ee8
--- /dev/null
+++ b/pymarkdown/container_blocks/container_block_nested_processor.py
@@ -0,0 +1,581 @@
+"""
+Module to provide processing for the nested scenarios that may contain container blocks.
+"""
+from __future__ import annotations
+
+import logging
+from typing import Optional, Tuple, cast
+
+from pymarkdown.block_quote_data import BlockQuoteData
+from pymarkdown.block_quote_processor import BlockQuoteProcessor
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_indices import ContainerIndices
+from pymarkdown.container_markdown_token import BlockQuoteMarkdownToken
+from pymarkdown.list_block_processor import ListBlockProcessor
+from pymarkdown.parser_helper import ParserHelper
+from pymarkdown.parser_logger import ParserLogger
+from pymarkdown.parser_state import ParserState
+from pymarkdown.position_marker import PositionMarker
+from pymarkdown.stack_token import ListStackToken
+
+POGGER = ParserLogger(logging.getLogger(__name__))
+
+
+# pylint: disable=too-few-public-methods
+class ContainerBlockNestedProcessor:
+    """
+    Class to provide processing for the nested scenarios that may contain container blocks.
+    """
+
+    @staticmethod
+    def handle_nested_container_blocks(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        was_container_start: bool,
+        avoid_block_starts: bool,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[Optional[str], bool, bool]:
+        """
+        Handle the processing of nested container blocks, as they can contain
+        themselves and get somewhat messy.
+        """
+        adjusted_text_to_parse = position_marker.text_to_parse
+
+        POGGER.debug("adjusted_text_to_parse>$<", adjusted_text_to_parse)
+        POGGER.debug("index_number>$<", position_marker.index_number)
+        POGGER.debug("index_indent>$<", position_marker.index_indent)
+        POGGER.debug("parser_state.nested_list_start>$", parser_state.nested_list_start)
+        POGGER.debug("was_container_start>$", was_container_start)
+
+        if was_container_start and position_marker.text_to_parse:
+            assert grab_bag.container_depth < 10
+            nested_container_starts = (
+                ContainerBlockNestedProcessor.__get_nested_container_starts(
+                    parser_state,
+                    position_marker.text_to_parse,
+                    avoid_block_starts,
+                )
+            )
+            POGGER.debug(
+                "__handle_nested_container_blocks>nested_container_starts>>:$:<<",
+                nested_container_starts,
+            )
+
+            grab_bag.adj_line_to_parse = position_marker.text_to_parse
+
+            (
+                indent_level_delta,
+                already_adjusted,
+                active_container_index,
+            ) = ContainerBlockNestedProcessor.__check_for_nested_list_start(
+                parser_state,
+                nested_container_starts,
+                grab_bag,
+            )
+
+            assert grab_bag.is_leaf_tokens_empty()
+            adjusted_text_to_parse = ContainerBlockNestedProcessor.__do_nested_cleanup(
+                parser_state,
+                indent_level_delta,
+                already_adjusted,
+                active_container_index,
+                adjusted_text_to_parse,
+                grab_bag,
+            )
+            # POGGER.debug_with_visible_whitespace("adjusted_text_to_parse>>$>>", adjusted_text_to_parse)
+
+            (
+                adjusted_text_to_parse,
+                nested_removed_text,
+                was_indent_text_added,
+                inner_force_list_continuation,
+            ) = ContainerBlockNestedProcessor.__check_for_next_container(
+                parser_state,
+                position_marker,
+                nested_container_starts,
+                adjusted_text_to_parse,
+                grab_bag,
+            )
+        else:
+            (
+                nested_removed_text,
+                was_indent_text_added,
+                inner_force_list_continuation,
+            ) = (
+                None,
+                False,
+                False,
+            )
+
+        # POGGER.debug_with_visible_whitespace("adjusted_text_to_parse>>$>>", adjusted_text_to_parse)
+        grab_bag.line_to_parse = adjusted_text_to_parse
+        return (
+            nested_removed_text,
+            was_indent_text_added,
+            inner_force_list_continuation,
+        )
+
+    @staticmethod
+    def __check_for_next_container(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        nested_container_starts: ContainerIndices,
+        adjusted_text_to_parse: str,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[str, Optional[str], bool, bool]:
+        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
+        POGGER.debug(
+            "check next container_start>tokenized_document>>$",
+            parser_state.token_document,
+        )
+
+        if (
+            nested_container_starts.ulist_index
+            or nested_container_starts.olist_index
+            or nested_container_starts.block_index
+        ):
+            POGGER.debug(
+                "check next container_start>nested_container",
+            )
+            (
+                adjusted_text_to_parse,
+                nested_removed_text,
+                was_indent_text_added,
+                inner_force_list_continuation,
+            ) = ContainerBlockNestedProcessor.__look_for_container_blocks(
+                parser_state,
+                position_marker,
+                grab_bag,
+            )
+        else:
+            (
+                nested_removed_text,
+                was_indent_text_added,
+                inner_force_list_continuation,
+            ) = (None, False, False)
+        parser_state.set_no_para_start_if_empty()
+
+        return (
+            adjusted_text_to_parse,
+            nested_removed_text,
+            was_indent_text_added,
+            inner_force_list_continuation,
+        )
+
+    @staticmethod
+    def __get_nested_container_starts(
+        parser_state: ParserState,
+        line_to_parse: str,
+        avoid_block_starts: bool,
+    ) -> ContainerIndices:
+        POGGER.debug(
+            "__handle_nested_container_blocks>stack>>:$:<<",
+            line_to_parse,
+        )
+
+        POGGER.debug("check next container_start>")
+        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
+
+        _, ex_ws_test = ParserHelper.extract_spaces(line_to_parse, 0)
+        assert ex_ws_test is not None
+
+        whitespace_scan_start_index = 0
+        for token_stack_item in parser_state.token_stack:
+            if token_stack_item.is_list:
+                list_stack_token = cast(ListStackToken, token_stack_item)
+                if list_stack_token.ws_before_marker <= len(ex_ws_test):
+                    whitespace_scan_start_index = list_stack_token.ws_before_marker
+
+        after_ws_index, ex_whitespace = ParserHelper.extract_spaces(
+            line_to_parse, whitespace_scan_start_index
+        )
+        if not ex_whitespace:
+            ex_whitespace = ""
+            after_ws_index = whitespace_scan_start_index
+
+        assert after_ws_index is not None
+
+        nested_ulist_start, _, _, _ = ListBlockProcessor.is_ulist_start(
+            parser_state, line_to_parse, after_ws_index, ex_whitespace, False
+        )
+        nested_olist_start, _, _, _ = ListBlockProcessor.is_olist_start(
+            parser_state, line_to_parse, after_ws_index, ex_whitespace, False
+        )
+        nested_block_start = (
+            False
+            if avoid_block_starts
+            else BlockQuoteProcessor.is_block_quote_start(
+                line_to_parse, after_ws_index, ex_whitespace
+            )
+        )
+
+        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
+
+        return ContainerIndices(
+            nested_ulist_start, nested_olist_start, nested_block_start
+        )
+
+    @staticmethod
+    def __look_for_container_blocks(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[str, Optional[str], bool, bool]:
+        """
+        Look for container blocks that we can use.
+        """
+        POGGER.debug("check next container_start>recursing")
+        adj_block, position_marker = (
+            None
+            if grab_bag.end_container_indices.block_index == -1
+            else grab_bag.end_container_indices.block_index,
+            PositionMarker(position_marker.line_number, -1, grab_bag.adj_line_to_parse),
+        )
+        new_container_depth = grab_bag.container_depth + 1
+
+        POGGER.debug(
+            "position_marker>:$:$:",
+            position_marker.index_number,
+            position_marker.text_to_parse,
+        )
+        POGGER.debug("adj_block>:$:", adj_block)
+        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,
+            adjusted_text_to_parse,
+            current_bq_count_increment,
+            grab_bag.requeue_line_info,
+            grab_bag.did_blank,
+            inner_force_list_continuation,
+        ) = grab_bag.get_recurse_fn()(
+            parser_state,
+            position_marker,
+            False,
+            grab_bag.parser_properties,
+            grab_bag.block_quote_data.current_count,
+            new_container_depth,
+            adj_block,
+            grab_bag.block_quote_data.current_count,
+            grab_bag.original_line,
+        )
+        assert (
+            not grab_bag.requeue_line_info
+            or not grab_bag.requeue_line_info.lines_to_requeue
+        )
+        assert adjusted_text_to_parse is not None
+
+        POGGER.debug("\nRECURSED\n\n")
+
+        # POGGER.debug("previous_document_length=$", previous_document_length)
+        nested_removed_text = (
+            ContainerBlockNestedProcessor.__calculate_nested_removed_text(
+                parser_state, previous_document_length, grab_bag
+            )
+        )
+        POGGER.debug("check next container_start>stack>>$", parser_state.token_stack)
+        POGGER.debug(
+            "check next container_start>tokenized_document>>$",
+            parser_state.token_document,
+        )
+        POGGER.debug("check next container_start>line_parse>>$", adjusted_text_to_parse)
+        if current_bq_count_increment:
+            grab_bag.block_quote_data = BlockQuoteData(
+                grab_bag.block_quote_data.current_count + current_bq_count_increment,
+                parser_state.count_of_block_quotes_on_stack(),
+            )
+
+        POGGER.debug("produced_inner_tokens=$", produced_inner_tokens)
+        was_indent_text_added = bool(
+            parser_state.token_stack[-1].is_indented_code_block
+            and produced_inner_tokens
+            and len(produced_inner_tokens) == 1
+            and produced_inner_tokens[0].is_text
+        )
+        POGGER.debug("was_indent_text_added=$", was_indent_text_added)
+
+        # 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)
+
+        return (
+            adjusted_text_to_parse,
+            nested_removed_text,
+            was_indent_text_added,
+            inner_force_list_continuation,
+        )
+
+    @staticmethod
+    def __calculate_nested_removed_text(
+        parser_state: ParserState,
+        previous_document_length: int,
+        grab_bag: ContainerGrabBag,
+    ) -> Optional[str]:
+        nested_removed_text = None
+        POGGER.debug("__calculate_nested_removed_text")
+        POGGER.debug(
+            "__cnrt->token_doc($)",
+            ParserHelper.make_value_visible(parser_state.token_document),
+        )
+        if previous_document_length != len(parser_state.token_document):
+            POGGER.debug(
+                "\ncheck next container_start>added tokens:$:",
+                parser_state.token_document[previous_document_length:],
+            )
+            if parser_state.token_document[-1].is_block_quote_start:
+                block_quote_token = cast(
+                    BlockQuoteMarkdownToken, parser_state.token_document[-1]
+                )
+                nested_removed_text = ContainerBlockNestedProcessor.__calculate_nested_removed_text_block_quote(
+                    parser_state, block_quote_token, grab_bag
+                )
+        if not nested_removed_text:
+            POGGER.debug("__cnrt:nested_removed_text:$:", nested_removed_text)
+            last_container_index = parser_state.find_last_container_on_stack()
+            if (
+                last_container_index > 0
+                and parser_state.token_stack[last_container_index].is_block_quote
+            ):
+                block_quote_token = cast(
+                    BlockQuoteMarkdownToken,
+                    parser_state.token_stack[
+                        last_container_index
+                    ].matching_markdown_token,
+                )
+                assert block_quote_token.bleading_spaces is not None
+                split_spaces = block_quote_token.bleading_spaces.split(
+                    ParserHelper.newline_character
+                )
+                nested_removed_text = str(split_spaces[-1])
+        POGGER.debug("__calculate_nested_removed_text<<:$:", nested_removed_text)
+        return nested_removed_text
+
+    @staticmethod
+    def __calculate_nested_removed_text_block_quote(
+        parser_state: ParserState,
+        block_quote_token: BlockQuoteMarkdownToken,
+        grab_bag: ContainerGrabBag,
+    ) -> str:
+        assert block_quote_token.bleading_spaces is not None
+        split_spaces = block_quote_token.bleading_spaces.split(
+            ParserHelper.newline_character
+        )
+        nested_removed_text = str(split_spaces[-1])
+        POGGER.debug("nested_removed_text:$:", nested_removed_text)
+        if (
+            len(parser_state.token_document) > 1
+            and parser_state.token_document[-2].is_new_list_item
+            and parser_state.token_document[-2].line_number
+            == parser_state.token_document[-1].line_number
+        ):
+            column_number_delta = (
+                parser_state.token_document[-1].column_number
+                - parser_state.token_document[-2].column_number
+            )
+            block_quote_character_index = nested_removed_text.index(">")
+            nested_removed_text_length = len(nested_removed_text)
+            POGGER.debug(
+                "column_number_delta=$, block_quote_character_index=$, nested_removed_text_length=$",
+                column_number_delta,
+                block_quote_character_index,
+                nested_removed_text_length,
+            )
+            adjusted_length = (
+                parser_state.token_document[-2].column_number
+                - 1
+                + column_number_delta
+                + (nested_removed_text_length - block_quote_character_index)
+            )
+            POGGER.debug("adjusted_length=$", adjusted_length)
+            if adjusted_length != nested_removed_text_length:
+                assert parser_state.original_line_to_parse
+                nested_removed_text = parser_state.original_line_to_parse[
+                    :adjusted_length
+                ]
+                POGGER.debug("previous:$:", nested_removed_text)
+                grab_bag.weird_adjusted_text = nested_removed_text
+        return nested_removed_text
+
+    @staticmethod
+    def __check_for_nested_list_start(
+        parser_state: ParserState,
+        nested_container_starts: ContainerIndices,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[int, bool, int]:
+        active_container_index = max(
+            grab_bag.end_container_indices.ulist_index,
+            grab_bag.end_container_indices.olist_index,
+            grab_bag.end_container_indices.block_index,
+        )
+        POGGER.debug(
+            "check next container_start>max>>$>>bq>>$",
+            active_container_index,
+            grab_bag.end_container_indices.block_index,
+        )
+        indent_level_delta, already_adjusted = 0, False
+        if (
+            grab_bag.end_container_indices.block_index != -1
+            and not nested_container_starts.ulist_index
+            and not nested_container_starts.olist_index
+        ):
+            assert active_container_index == grab_bag.end_container_indices.block_index
+            POGGER.debug(
+                "parser_state.nested_list_start>>$<<",
+                parser_state.nested_list_start,
+            )
+            POGGER.debug(
+                "parser_state.token_document>>$<<", parser_state.token_document
+            )
+            if parser_state.nested_list_start and grab_bag.adj_line_to_parse.strip():
+                (
+                    grab_bag.start_index,
+                    indent_level,
+                    indent_was_adjusted,
+                    indent_level_delta,
+                ) = ContainerBlockNestedProcessor.__calculate_initial_list_adjustments(
+                    parser_state,
+                    grab_bag.adj_line_to_parse,
+                    grab_bag.end_container_indices,
+                )
+                already_adjusted = ContainerBlockNestedProcessor.__adjust_line_2(
+                    parser_state,
+                    indent_level,
+                    nested_container_starts,
+                    indent_was_adjusted,
+                    grab_bag,
+                )
+        return (
+            indent_level_delta,
+            already_adjusted,
+            active_container_index,
+        )
+
+    @staticmethod
+    def __adjust_line_2(
+        parser_state: ParserState,
+        indent_level: int,
+        nested_container_starts: ContainerIndices,
+        indent_was_adjusted: bool,
+        grab_bag: ContainerGrabBag,
+    ) -> bool:
+        if (
+            parser_state.token_document[-1].is_blank_line
+            and (grab_bag.end_container_indices.block_index + grab_bag.start_index)
+            < indent_level
+        ):
+            POGGER.debug("\n\nBOOM\n\n")
+
+            y_tokens = []
+            while parser_state.token_document[-1].is_blank_line:
+                y_tokens.append(parser_state.token_document[-1])
+                del parser_state.token_document[-1]
+
+            x_tokens, _ = parser_state.close_open_blocks_fn(
+                parser_state,
+                include_lists=True,
+            )
+            parser_state.token_document.extend(x_tokens)
+            parser_state.token_document.extend(y_tokens)
+        elif (
+            not nested_container_starts.block_index
+            and grab_bag.adj_line_to_parse
+            and grab_bag.adj_line_to_parse[0] == ParserHelper.space_character
+            and indent_was_adjusted
+            and parser_state.nested_list_start
+        ):
+            assert parser_state.nested_list_start is not None
+        return False
+
+    @staticmethod
+    def __calculate_initial_list_adjustments(
+        parser_state: ParserState,
+        adj_line_to_parse: str,
+        end_container_indices: ContainerIndices,
+    ) -> Tuple[int, int, bool, int]:
+        start_index, _ = ParserHelper.extract_spaces(adj_line_to_parse, 0)
+        assert start_index is not None
+        POGGER.debug("start_index>>$<<", start_index)
+
+        assert parser_state.nested_list_start is not None
+        assert parser_state.nested_list_start.matching_markdown_token is not None
+        POGGER.debug(
+            "parser_state.nested_list_start.matching_markdown_token>>$<<",
+            parser_state.nested_list_start.matching_markdown_token,
+        )
+        list_start_token_index = parser_state.token_document.index(
+            parser_state.nested_list_start.matching_markdown_token
+        )
+        POGGER.debug(
+            "list_start_token_index>>$<<",
+            list_start_token_index,
+        )
+        if list_start_token_index < (len(parser_state.token_document) - 1):
+            token_after_list_start = parser_state.token_document[
+                list_start_token_index + 1
+            ]
+            POGGER.debug(
+                "token_after_list_start>>$<<",
+                token_after_list_start,
+            )
+            assert (
+                parser_state.nested_list_start.matching_markdown_token.line_number
+                == token_after_list_start.line_number
+            )
+            column_number_delta = (
+                token_after_list_start.column_number
+                - parser_state.nested_list_start.matching_markdown_token.column_number
+            )
+        else:
+            column_number_delta = 0
+        POGGER.debug(
+            "column_number_delta>>$<<",
+            column_number_delta,
+        )
+        indent_level_delta, indent_level, adjusted_indent_level = (
+            0,
+            parser_state.nested_list_start.indent_level,
+            column_number_delta + end_container_indices.block_index,
+        )
+        POGGER.debug(
+            "adjusted_indent_level>>$<<  indent_level>$",
+            adjusted_indent_level,
+            indent_level,
+        )
+        indent_was_adjusted = indent_level != adjusted_indent_level
+        if indent_level > adjusted_indent_level:
+            indent_level_delta = indent_level - adjusted_indent_level
+        indent_level = column_number_delta + end_container_indices.block_index
+
+        return start_index, indent_level, indent_was_adjusted, indent_level_delta
+
+    # pylint: disable=too-many-arguments
+    @staticmethod
+    def __do_nested_cleanup(
+        parser_state: ParserState,
+        delta: int,
+        already_adjusted: bool,
+        active_container_index: int,
+        adjusted_text_to_parse: str,
+        grab_bag: ContainerGrabBag,
+    ) -> str:
+        if delta or already_adjusted:
+            adjusted_text_to_parse = grab_bag.adj_line_to_parse
+        else:
+            POGGER.debug("active_container_index<<$<<", active_container_index)
+            adjustment_filler = ParserHelper.repeat_string(
+                ParserHelper.space_character, active_container_index
+            )
+            grab_bag.adj_line_to_parse = (
+                f"{adjustment_filler}{grab_bag.adj_line_to_parse}"
+            )
+
+        parser_state.token_document.extend(grab_bag.container_tokens)
+        grab_bag.clear_container_tokens()
+        return adjusted_text_to_parse
+
+    # pylint: enable=too-many-arguments
+
+
+# pylint: enable=too-few-public-methods
diff --git a/pymarkdown/container_blocks/container_block_non_leaf_processor.py b/pymarkdown/container_blocks/container_block_non_leaf_processor.py
new file mode 100644
index 00000000..b0db5ed8
--- /dev/null
+++ b/pymarkdown/container_blocks/container_block_non_leaf_processor.py
@@ -0,0 +1,794 @@
+"""
+Module to provide processing for the non-leaf scenarios that may contain container blocks.
+"""
+from __future__ import annotations
+
+import logging
+from typing import Optional, Tuple, cast
+
+from pymarkdown.block_quote_processor import BlockQuoteProcessor
+from pymarkdown.container_blocks.container_block_nested_processor import (
+    ContainerBlockNestedProcessor,
+)
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_indices import ContainerIndices
+from pymarkdown.container_markdown_token import (
+    BlockQuoteMarkdownToken,
+    ListStartMarkdownToken,
+)
+from pymarkdown.leaf_blocks.leaf_block_processor_paragraph import (
+    LeafBlockProcessorParagraph,
+)
+from pymarkdown.list_block_processor import ListBlockProcessor
+from pymarkdown.parser_helper import ParserHelper
+from pymarkdown.parser_logger import ParserLogger
+from pymarkdown.parser_state import ParserState
+from pymarkdown.position_marker import PositionMarker
+
+POGGER = ParserLogger(logging.getLogger(__name__))
+
+
+class ContainerBlockNonLeafProcessor:
+    """
+    Class to provide processing for the non-leaf scenarios that may contain container blocks.
+    """
+
+    @staticmethod
+    def handle_non_leaf_block(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        # POGGER.debug("ttp>>:$:<", position_marker.text_to_parse)
+        # POGGER.debug("index_number>>:$:<", position_marker.index_number)
+        # POGGER.debug("index_indent>>:$:<", position_marker.index_indent)
+        ContainerBlockNonLeafProcessor.__handle_pre_processed_indent(
+            parser_state,
+            position_marker,
+            grab_bag,
+        )
+        # assert grab_bag.extracted_whitespace is not None
+        if ContainerBlockNonLeafProcessor.__look_for_override(
+            parser_state,
+            position_marker,
+            grab_bag,
+        ):
+            ContainerBlockNonLeafProcessor.__handle_normal_containers(
+                parser_state,
+                position_marker,
+                grab_bag,
+            )
+
+    @staticmethod
+    def __handle_pre_processed_indent(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        assert grab_bag.extracted_whitespace is not None
+        need_leading_whitespace_processing = (
+            grab_bag.container_depth < (len(parser_state.token_stack) - 1)
+            and len(grab_bag.extracted_whitespace) >= 4
+            and not parser_state.token_stack[-1].is_html_block
+            and not parser_state.token_stack[-1].is_fenced_code_block
+        )
+        need_trailing_indent_processing = (
+            grab_bag.container_depth >= len(parser_state.token_stack) - 1
+            and position_marker.index_number == -1
+        )
+        if need_trailing_indent_processing:
+            POGGER.debug(">>trailing_indent_processing")
+            ContainerBlockNonLeafProcessor.__handle_trailing_indent_with_block_quote(
+                parser_state, grab_bag
+            )
+        elif need_leading_whitespace_processing:
+            POGGER.debug(">>leading_whitespace_preprocessing")
+            ContainerBlockNonLeafProcessor.__determine_leading_whitespace_preprocessing(
+                parser_state,
+                position_marker,
+                grab_bag,
+            )
+
+    @staticmethod
+    def __look_for_override(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> bool:
+        if grab_bag.have_pre_processed_indent:
+            (
+                grab_bag.can_continue,
+                grab_bag.line_to_parse,
+                grab_bag.start_index,
+                grab_bag.removed_chars_at_start_of_line,
+            ) = (
+                True,
+                position_marker.text_to_parse[grab_bag.indent_already_processed :],
+                grab_bag.indent_already_processed,
+                grab_bag.indent_already_processed,
+            )
+        keep_processing = (
+            not grab_bag.can_continue
+            and not grab_bag.do_skip_containers_before_leaf_blocks
+        )
+        if keep_processing:
+            last_container_stack_token = parser_state.token_stack[
+                parser_state.find_last_container_on_stack()
+            ]
+            POGGER.debug("last_container_stack_token>>$", last_container_stack_token)
+            if last_container_stack_token.is_block_quote:
+                block_token = cast(
+                    BlockQuoteMarkdownToken,
+                    last_container_stack_token.matching_markdown_token,
+                )
+                assert block_token.bleading_spaces is not None
+                split_spaces = block_token.bleading_spaces.split(
+                    ParserHelper.newline_character
+                )
+                last_leading_space = split_spaces[-1]
+                ex_ws_index, _ = ParserHelper.extract_spaces(last_leading_space, 0)
+                assert grab_bag.adj_ws is not None
+                if (
+                    len(grab_bag.adj_ws) >= 4
+                    and grab_bag.indent_used_by_container
+                    and grab_bag.indent_used_by_container == ex_ws_index
+                ):
+                    keep_processing = False
+                    grab_bag.indent_already_processed = len(last_leading_space)
+                    grab_bag.weird_adjusted_text = last_leading_space
+                    (
+                        grab_bag.can_continue,
+                        grab_bag.line_to_parse,
+                        grab_bag.start_index,
+                        grab_bag.removed_chars_at_start_of_line,
+                    ) = (
+                        True,
+                        position_marker.text_to_parse[
+                            grab_bag.indent_already_processed :
+                        ],
+                        grab_bag.indent_already_processed,
+                        grab_bag.indent_already_processed,
+                    )
+        return keep_processing
+
+    @staticmethod
+    def __handle_normal_containers(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        (
+            did_process,
+            avoid_block_starts,
+        ) = ContainerBlockNonLeafProcessor.__check_for_container_starts(
+            parser_state,
+            position_marker,
+            grab_bag,
+        )
+
+        if grab_bag.requeue_line_info or grab_bag.did_blank:
+            grab_bag.can_continue = False
+            return
+
+        nested_force_list_continuation = (
+            ContainerBlockNonLeafProcessor.__handle_nested_blocks(
+                parser_state,
+                position_marker,
+                did_process,
+                avoid_block_starts,
+                grab_bag,
+            )
+        )
+        if grab_bag.do_force_list_continuation:
+            POGGER.debug(
+                "nested_force_list_continuation=$", nested_force_list_continuation
+            )
+            assert not nested_force_list_continuation
+        if grab_bag.can_continue:
+            did_process = ContainerBlockNonLeafProcessor.__handle_block_continuations(
+                parser_state,
+                position_marker,
+                did_process,
+                grab_bag,
+            )
+
+    @staticmethod
+    def __handle_trailing_indent_with_block_quote(
+        parser_state: ParserState,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        grab_bag.did_indent_processing = True
+        assert grab_bag.extracted_whitespace is not None
+        for stack_capture_index in range(1, len(parser_state.token_stack)):
+            POGGER.debug(
+                "$>stack:$:",
+                stack_capture_index,
+                parser_state.token_stack[stack_capture_index],
+            )
+            inner_token = parser_state.token_stack[
+                stack_capture_index
+            ].matching_markdown_token
+            assert inner_token is not None
+            POGGER.debug(
+                "$>token:$:",
+                stack_capture_index,
+                inner_token,
+            )
+            if inner_token.is_block_quote_start:
+                block_quote_token = cast(BlockQuoteMarkdownToken, inner_token)
+                assert block_quote_token.bleading_spaces is not None
+                split_spaces = block_quote_token.bleading_spaces.split("\n")
+                grab_bag.indent_already_processed = len(split_spaces[-1])
+            else:
+                assert inner_token.is_list_start
+                list_token = cast(ListStartMarkdownToken, inner_token)
+                grab_bag.indent_already_processed = list_token.indent_level
+        delta = len(grab_bag.extracted_whitespace) - grab_bag.indent_already_processed
+        POGGER.debug("len(ws)=$", len(grab_bag.extracted_whitespace))
+        POGGER.debug("len(containers)=$", grab_bag.indent_already_processed)
+        grab_bag.have_pre_processed_indent = (
+            grab_bag.indent_already_processed != -1 and delta >= 4
+        )
+
+        grab_bag.do_skip_containers_before_leaf_blocks = (
+            grab_bag.have_pre_processed_indent
+        )
+
+    @staticmethod
+    def __determine_leading_whitespace_preprocessing(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        assert grab_bag.extracted_whitespace is not None
+        grab_bag.indent_used_by_container = 0
+        if grab_bag.is_para_continue and not grab_bag.container_depth:
+            ContainerBlockNonLeafProcessor.__special_list_block_block(
+                parser_state, position_marker, grab_bag
+            )
+        elif not grab_bag.is_para_continue:
+            POGGER.debug(
+                "position_marker.index_number:$:", position_marker.index_number
+            )
+            leading_whitespace: Optional[str] = grab_bag.extracted_whitespace
+            if position_marker.index_number == -1 and grab_bag.container_depth:
+                leading_whitespace = (
+                    ContainerBlockNonLeafProcessor.__calculate_indent_used_by_container(
+                        parser_state, position_marker, leading_whitespace, grab_bag
+                    )
+                )
+            assert leading_whitespace is not None
+            if len(leading_whitespace) >= 4:
+                POGGER.debug(">>leading_whitespace_processing")
+                ContainerBlockNonLeafProcessor.__handle_leading_whitespace(
+                    parser_state,
+                    position_marker,
+                    leading_whitespace,
+                    grab_bag,
+                )
+                (
+                    grab_bag.did_indent_processing,
+                    grab_bag.was_indent_already_processed,
+                ) = (True, bool(grab_bag.container_depth))
+            POGGER.debug("parser_state.token_document=$", parser_state.token_document)
+
+    @staticmethod
+    def __check_for_container_starts(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[bool, bool]:
+        parser_state.nested_list_start = None
+        ulist_index = -1
+        olist_index = -1
+        (
+            did_process,
+            block_index,
+            avoid_block_starts,
+        ) = ContainerBlockNonLeafProcessor.__get_block_start_index(
+            parser_state,
+            position_marker,
+            grab_bag,
+        )
+        if grab_bag.can_continue:
+            # POGGER.debug(">>avoid_block_starts>>$", avoid_block_starts)
+            # POGGER.debug(">>did_process>>$", did_process)
+
+            (
+                did_process,
+                ulist_index,
+            ) = ContainerBlockNonLeafProcessor.__get_list_start_index(
+                parser_state,
+                position_marker,
+                True,
+                did_process,
+                grab_bag,
+            )
+
+        if grab_bag.can_continue:
+            # POGGER.debug("was_container_start>>$", was_container_start)
+            (
+                did_process,
+                olist_index,
+            ) = ContainerBlockNonLeafProcessor.__get_list_start_index(
+                parser_state,
+                position_marker,
+                False,
+                did_process,
+                grab_bag,
+            )
+
+        grab_bag.end_container_indices = ContainerIndices(
+            block_index=block_index, ulist_index=ulist_index, olist_index=olist_index
+        )
+        return (
+            did_process,
+            avoid_block_starts,
+        )
+
+    @staticmethod
+    def __handle_nested_blocks(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        was_container_start: bool,
+        avoid_block_starts: bool,
+        grab_bag: ContainerGrabBag,
+    ) -> bool:
+        grab_bag.last_list_start_index = 0
+        if grab_bag.end_container_indices.block_index != -1:
+            assert grab_bag.last_block_quote_index in (
+                grab_bag.end_container_indices.block_index - 1,
+                grab_bag.end_container_indices.block_index,
+            )
+        elif grab_bag.end_container_indices.olist_index != -1:
+            grab_bag.last_list_start_index = grab_bag.end_container_indices.olist_index
+        elif grab_bag.end_container_indices.ulist_index != -1:
+            grab_bag.last_list_start_index = grab_bag.end_container_indices.ulist_index
+
+        if not parser_state.token_stack[-1].is_fenced_code_block:
+            new_position_marker = PositionMarker(
+                position_marker.line_number,
+                grab_bag.start_index,
+                grab_bag.line_to_parse,
+            )
+            # POGGER.debug("was_container_start>>$", was_container_start)
+            (
+                nested_removed_text,
+                was_indent_text_added,
+                nested_force_list_continuation,
+            ) = ContainerBlockNestedProcessor.handle_nested_container_blocks(
+                parser_state,
+                new_position_marker,
+                was_container_start,
+                avoid_block_starts,
+                grab_bag,
+            )
+        else:
+            (
+                nested_removed_text,
+                was_indent_text_added,
+                nested_force_list_continuation,
+            ) = (None, False, False)
+
+        POGGER.debug_with_visible_whitespace(
+            "nested_removed_text>>>:$:", nested_removed_text
+        )
+        if nested_removed_text is not None:
+            grab_bag.text_removed_by_container = nested_removed_text
+        grab_bag.can_continue = not (
+            grab_bag.container_depth or grab_bag.did_blank or was_indent_text_added
+        )
+        POGGER.debug(
+            ">>can_continue>>:$: = not(container_depth($) or "
+            + "did_process_blank_line($) or was_indent_text_added($))",
+            grab_bag.can_continue,
+            grab_bag.container_depth,
+            grab_bag.did_blank,
+            was_indent_text_added,
+        )
+        return nested_force_list_continuation
+
+    @staticmethod
+    def __handle_block_continuations(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        did_process: bool,
+        grab_bag: ContainerGrabBag,
+    ) -> bool:
+        if not did_process:
+            did_process = ContainerBlockNonLeafProcessor.__process_list_in_progress(
+                parser_state,
+                grab_bag,
+            )
+            if not grab_bag.requeue_line_info:
+                ContainerBlockNonLeafProcessor.__process_lazy_lines(
+                    parser_state,
+                    position_marker,
+                    grab_bag,
+                )
+        else:
+            is_paragraph_continuation = (
+                parser_state.token_stack and parser_state.token_stack[-1].is_paragraph
+            )
+            list_index = parser_state.find_last_list_block_on_stack()
+            block_index = parser_state.find_last_block_quote_on_stack()
+            if is_paragraph_continuation and block_index > list_index:
+                grab_bag.was_paragraph_continuation = True
+
+        grab_bag.can_continue = not grab_bag.requeue_line_info
+        return did_process
+
+    @staticmethod
+    def __special_list_block_block(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        if not (
+            parser_state.token_stack[1].is_list
+            and parser_state.token_stack[2].is_block_quote
+            and parser_state.token_stack[3].is_block_quote
+            and parser_state.token_stack[4].is_paragraph
+            and parser_state.token_stack[1].matching_markdown_token
+            and parser_state.token_stack[3].matching_markdown_token
+            and parser_state.token_stack[1].matching_markdown_token.line_number
+            == parser_state.token_stack[3].matching_markdown_token.line_number
+        ):
+            return
+        list_token = cast(
+            ListStartMarkdownToken,
+            parser_state.token_stack[1].matching_markdown_token,
+        )
+        container_x_used_indent = list_token.indent_level
+        assert grab_bag.extracted_whitespace is not None
+        extracted_whitespace_length = len(grab_bag.extracted_whitespace)
+        POGGER.debug("text_to_parse=:$:", position_marker.text_to_parse)
+        POGGER.debug(
+            "text_to_parse[rt($)]=:$:",
+            extracted_whitespace_length,
+            position_marker.text_to_parse[extracted_whitespace_length],
+        )
+        POGGER.debug("index_number=:$:", position_marker.index_number)
+        if not (
+            container_x_used_indent != extracted_whitespace_length
+            and position_marker.text_to_parse[extracted_whitespace_length] == ">"
+            and extracted_whitespace_length - container_x_used_indent >= 4
+        ):
+            return
+        list_token.add_leading_spaces(
+            grab_bag.extracted_whitespace[:container_x_used_indent]
+        )
+        (
+            grab_bag.do_skip_containers_before_leaf_blocks,
+            grab_bag.did_indent_processing,
+            grab_bag.have_pre_processed_indent,
+            grab_bag.do_force_leaf_token_parse,
+            grab_bag.indent_already_processed,
+        ) = (True, True, True, True, container_x_used_indent)
+
+    @staticmethod
+    def __calculate_indent_used_by_container(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        leading_whitespace: Optional[str],
+        grab_bag: ContainerGrabBag,
+    ) -> Optional[str]:
+        POGGER.debug("original_line_to_parse:$:", parser_state.original_line_to_parse)
+        POGGER.debug("leading_whitespace:$:", leading_whitespace)
+        POGGER.debug("text_to_parse=:$:", position_marker.text_to_parse)
+        POGGER.debug("parser_state.token_stack=:$:", parser_state.token_stack)
+        stack_search_index, current_indent = 1, 0
+        assert parser_state.original_line_to_parse is not None
+        while stack_search_index <= grab_bag.container_depth:
+            if parser_state.token_stack[stack_search_index].is_block_quote:
+                current_indent = parser_state.original_line_to_parse.find(">")
+                assert current_indent != -1
+                assert (
+                    parser_state.original_line_to_parse[current_indent + 1]
+                    == ParserHelper.space_character
+                )
+                current_indent += 1
+
+                # TODO add tests with no space between `>` and next block
+                assert (
+                    current_indent < len(parser_state.original_line_to_parse)
+                    and parser_state.original_line_to_parse[current_indent]
+                    == ParserHelper.space_character
+                )
+                current_indent += 1
+            else:
+                assert parser_state.token_stack[stack_search_index].is_list
+                list_token = cast(
+                    ListStartMarkdownToken, parser_state.token_stack[stack_search_index]
+                )
+                delta = list_token.indent_level - current_indent
+                POGGER.debug("delta=:$:", delta)
+                current_indent += delta
+            stack_search_index += 1
+        assert stack_search_index > grab_bag.container_depth
+        _, leading_whitespace = ParserHelper.extract_spaces(
+            parser_state.original_line_to_parse, current_indent
+        )
+        POGGER.debug("leading_whitespace=:$:", leading_whitespace)
+        grab_bag.indent_used_by_container = current_indent
+        return leading_whitespace
+
+    @staticmethod
+    def __handle_leading_whitespace(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        leading_whitespace: Optional[str],
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        assert leading_whitespace is not None
+        grab_bag.indent_already_processed, found_stack_index, remaining_whitespace = (
+            0,
+            0,
+            leading_whitespace[:],
+        )
+        POGGER.debug(">remaining_whitespace:$:", remaining_whitespace)
+        for i in range(grab_bag.container_depth + 1, len(parser_state.token_stack)):
+            (
+                do_break,
+                found_stack_index,
+                remaining_whitespace,
+            ) = ContainerBlockNonLeafProcessor.__handle_leading_whitespace_loop(
+                parser_state,
+                i,
+                remaining_whitespace,
+                grab_bag,
+            )
+            if do_break:
+                break
+        POGGER.debug(">stack_index:$:", found_stack_index)
+        if found_stack_index:
+            grab_bag.have_pre_processed_indent = True
+            close_tokens, _ = parser_state.close_open_blocks_fn(
+                parser_state,
+                include_lists=True,
+                include_block_quotes=True,
+                was_forced=True,
+                until_this_index=found_stack_index,
+            )
+            grab_bag.extend_container_tokens(close_tokens)
+            ind = parser_state.find_last_container_on_stack()
+            if parser_state.token_stack[ind].is_list:
+                ind2 = parser_state.find_last_block_quote_on_stack()
+                block_quote_end_index = (
+                    grab_bag.indent_used_by_container + 1 if ind2 else 0
+                )
+                extra_indent = 1 if grab_bag.container_depth else 0
+                list_token = cast(
+                    ListStartMarkdownToken,
+                    parser_state.token_stack[ind].matching_markdown_token,
+                )
+                list_token.add_leading_spaces(
+                    position_marker.text_to_parse[
+                        block_quote_end_index : grab_bag.indent_already_processed
+                        + extra_indent
+                    ]
+                )
+
+    @staticmethod
+    def __handle_leading_whitespace_loop(
+        parser_state: ParserState,
+        i: int,
+        remaining_whitespace: str,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[bool, int, str]:
+        found_stack_index = 0
+        # POGGER.debug(
+        #     "$>remaining_whitespace:$:($)",
+        #     i,
+        #     remaining_whitespace,
+        #     len(remaining_whitespace),
+        # )
+        # POGGER.debug("$>stack:$:", i, parser_state.token_stack[i])
+        # POGGER.debug(
+        #     "$>token:$:", i, parser_state.token_stack[i].matching_markdown_token
+        # )
+        inner_token = parser_state.token_stack[i].matching_markdown_token
+        assert inner_token is not None
+        if inner_token.is_block_quote_start:
+            start_bq_index = remaining_whitespace.find(">")
+            if start_bq_index < 0 or start_bq_index >= 4:
+                # POGGER.debug("1-->$>start_bq_index:$:", i, start_bq_index)
+                # POGGER.debug("$>remaining_whitespace:$:", i, remaining_whitespace)
+                if len(remaining_whitespace) >= 4:
+                    found_stack_index = i
+                return True, found_stack_index, remaining_whitespace
+            raise AssertionError()
+        if not inner_token.is_list_start:
+            # POGGER.debug("2-->")
+            if len(remaining_whitespace) >= 4:
+                found_stack_index = (
+                    i + 1 if parser_state.token_stack[i].is_indented_code_block else i
+                )
+            return True, found_stack_index, remaining_whitespace
+        assert inner_token.is_list_start
+        list_token = cast(ListStartMarkdownToken, inner_token)
+        assert grab_bag.indent_used_by_container >= 0
+        remaining_indent = list_token.indent_level - (
+            grab_bag.indent_already_processed + grab_bag.indent_used_by_container
+        )
+        # POGGER.debug("$>remaining_indent:$:", i, remaining_indent)
+        left_whitespace = remaining_whitespace[:remaining_indent]
+        # POGGER.debug("$>left_whitespace:$:", i, left_whitespace)
+        if len(left_whitespace) < remaining_indent:
+            if len(remaining_whitespace) >= 4:
+                found_stack_index = i
+            # POGGER.debug("3-->")
+            return True, found_stack_index, remaining_whitespace
+        remaining_whitespace = remaining_whitespace[remaining_indent:]
+        grab_bag.indent_already_processed = list_token.indent_level
+        return False, found_stack_index, remaining_whitespace
+
+    @staticmethod
+    def __process_lazy_lines(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        assert grab_bag.is_leaf_tokens_empty()
+        POGGER.debug("clt>>lazy-check")
+
+        after_ws_index, ex_whitespace = ParserHelper.extract_spaces(
+            grab_bag.line_to_parse, 0
+        )
+        remaining_line = grab_bag.line_to_parse[after_ws_index:]
+        POGGER.debug("__process_lazy_lines>>mod->ltp>$<", remaining_line)
+        POGGER.debug("__process_lazy_lines>>mod->ews>$<", ex_whitespace)
+
+        (
+            lazy_tokens,
+            grab_bag.block_quote_data,
+            grab_bag.was_paragraph_continuation,
+        ) = BlockQuoteProcessor.check_for_lazy_handling(
+            parser_state,
+            position_marker,
+            grab_bag.block_quote_data,
+            remaining_line,
+            ex_whitespace,
+            grab_bag.was_paragraph_continuation,
+        )
+        grab_bag.extend_container_tokens(lazy_tokens)
+
+    @staticmethod
+    def __get_block_start_index(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[bool, int, bool]:
+        POGGER.debug("text_to_parse>$<", position_marker.text_to_parse)
+        POGGER.debug("index_number>$<", position_marker.index_number)
+        POGGER.debug("index_indent>$<", position_marker.index_indent)
+        new_position_marker = PositionMarker(
+            position_marker.line_number,
+            grab_bag.start_index,
+            position_marker.text_to_parse,
+        )
+        POGGER.debug("text_to_parse>$<", new_position_marker.text_to_parse)
+        POGGER.debug("index_number>$<", new_position_marker.index_number)
+        assert grab_bag.container_start_bq_count is not None
+        (
+            did_process,
+            block_index,
+            block_leaf_tokens,
+            block_container_tokens,
+            avoid_block_starts,
+        ) = BlockQuoteProcessor.handle_block_quote_block(
+            parser_state,
+            new_position_marker,
+            grab_bag,
+        )
+        grab_bag.extend_container_tokens(block_container_tokens)
+        grab_bag.extend_leaf_tokens(block_leaf_tokens)
+
+        if grab_bag.requeue_line_info:
+            POGGER.debug(">>requeuing lines after looking for block start. returning.")
+
+        if grab_bag.did_blank:
+            POGGER.debug(">>already handled blank line. returning.")
+            grab_bag.extend_container_tokens_with_leaf_tokens()
+
+        grab_bag.can_continue = (
+            not grab_bag.requeue_line_info and not grab_bag.did_blank
+        )
+        return (
+            did_process,
+            block_index,
+            avoid_block_starts,
+        )
+
+    @staticmethod
+    def __process_list_in_progress(
+        parser_state: ParserState,
+        grab_bag: ContainerGrabBag,
+    ) -> bool:
+        did_process, ind = LeafBlockProcessorParagraph.check_for_list_in_process(
+            parser_state
+        )
+        if did_process:
+            assert not grab_bag.container_tokens
+            POGGER.debug("clt>>list-in-progress")
+            resultant_tokens = ListBlockProcessor.list_in_process(
+                parser_state,
+                ind,
+                grab_bag,
+            )
+            grab_bag.extend_container_tokens(resultant_tokens)
+
+        return did_process
+
+    @staticmethod
+    def __get_list_start_index(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        is_ulist: bool,
+        did_process: bool,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[bool, int]:
+        """
+        Note: This is one of the more heavily traffic functions in the
+        parser.  Debugging should be uncommented only if needed.
+        """
+        new_position_marker = PositionMarker(
+            position_marker.line_number, grab_bag.start_index, grab_bag.line_to_parse
+        )
+
+        POGGER.debug(
+            "pre-list>>#$#$#$#",
+            position_marker.index_number,
+            position_marker.index_indent,
+            position_marker.text_to_parse,
+        )
+        POGGER.debug(
+            "pre-list>>#$#$#$#",
+            new_position_marker.index_number,
+            new_position_marker.index_indent,
+            new_position_marker.text_to_parse,
+        )
+        new_list_index = -1
+        if not did_process:
+            assert grab_bag.adj_ws is not None
+            assert grab_bag.extracted_whitespace is not None
+            assert grab_bag.removed_chars_at_start_of_line is not None
+            (
+                did_process,
+                new_list_index,
+                new_line_to_parse,
+                resultant_tokens,
+            ) = ListBlockProcessor.handle_list_block(
+                is_ulist,
+                parser_state,
+                new_position_marker,
+                grab_bag,
+            )
+            # POGGER.debug_with_visible_whitespace("handle_list_block>$", resultant_tokens)
+            if not grab_bag.requeue_line_info:
+                assert new_line_to_parse is not None
+                grab_bag.line_to_parse = new_line_to_parse
+                grab_bag.extend_container_tokens(resultant_tokens)
+        POGGER.debug(
+            "post-ulist>>#$#$#$#",
+            position_marker.index_number,
+            position_marker.index_indent,
+            position_marker.text_to_parse,
+        )
+        POGGER.debug(
+            "post-ulist>>#$#$#$#",
+            new_position_marker.index_number,
+            new_position_marker.index_indent,
+            new_position_marker.text_to_parse,
+        )
+
+        if grab_bag.requeue_line_info:
+            POGGER.debug(
+                ">>requeuing lines after looking for ordered list start. returning."
+            )
+
+        grab_bag.can_continue = not grab_bag.requeue_line_info
+        return (
+            did_process,
+            new_list_index,
+        )
diff --git a/pymarkdown/container_blocks/container_block_processor.py b/pymarkdown/container_blocks/container_block_processor.py
new file mode 100644
index 00000000..7c48e7a0
--- /dev/null
+++ b/pymarkdown/container_blocks/container_block_processor.py
@@ -0,0 +1,568 @@
+"""
+Module to provide processing for the container blocks.
+"""
+from __future__ import annotations
+
+import copy
+import logging
+from typing import TYPE_CHECKING, List, Optional, Tuple, cast
+
+from pymarkdown.block_quote_data import BlockQuoteData
+from pymarkdown.container_blocks.container_block_leaf_processor import (
+    ContainerBlockLeafProcessor,
+)
+from pymarkdown.container_blocks.container_block_non_leaf_processor import (
+    ContainerBlockNonLeafProcessor,
+)
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_markdown_token import (
+    BlockQuoteMarkdownToken,
+    ListStartMarkdownToken,
+)
+from pymarkdown.extensions.pragma_token import PragmaExtension
+from pymarkdown.markdown_token import EndMarkdownToken, MarkdownToken
+from pymarkdown.parser_helper import ParserHelper
+from pymarkdown.parser_logger import ParserLogger
+from pymarkdown.parser_state import ParserState
+from pymarkdown.position_marker import PositionMarker
+from pymarkdown.requeue_line_info import RequeueLineInfo
+from pymarkdown.tab_helper import TabHelper
+
+if TYPE_CHECKING:  # pragma: no cover
+    from pymarkdown.parse_block_pass_properties import ParseBlockPassProperties
+
+POGGER = ParserLogger(logging.getLogger(__name__))
+
+
+# pylint: disable=too-few-public-methods
+class ContainerBlockProcessor:
+    """
+    Class to provide processing for the container blocks.
+    """
+
+    @staticmethod
+    def __setup(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> Tuple[PositionMarker, bool, bool]:
+        POGGER.debug(">>")
+        POGGER.debug(">>")
+        if ContainerBlockProcessor.__look_for_pragmas(
+            position_marker,
+            grab_bag,
+        ):
+            return position_marker, True, False
+
+        position_marker = ContainerBlockProcessor.__prepare_container_start_variables(
+            parser_state,
+            position_marker,
+            grab_bag,
+        )
+
+        ContainerBlockProcessor.__prepare_container_start_variables2(
+            parser_state, position_marker, grab_bag
+        )
+
+        is_not_in_root_list = not (
+            parser_state.token_stack
+            and len(parser_state.token_stack) >= 2
+            and parser_state.token_stack[1].is_list
+        )
+
+        POGGER.debug(
+            "position_marker>:$:$:",
+            position_marker.index_number,
+            position_marker.text_to_parse,
+        )
+        return (
+            position_marker,
+            False,
+            is_not_in_root_list,
+        )
+
+    # pylint: disable=too-many-arguments
+    @staticmethod
+    def parse_line_for_container_blocks(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        ignore_link_definition_start: bool,
+        parser_properties: ParseBlockPassProperties,
+        container_start_bq_count: int,
+        container_depth: int = 0,
+        adjusted_block_index: Optional[int] = None,
+        initial_block_quote_count: Optional[int] = None,
+        original_line: Optional[str] = None,
+    ) -> Tuple[
+        List[MarkdownToken],
+        Optional[str],
+        Optional[int],
+        Optional[RequeueLineInfo],
+        bool,
+        bool,
+    ]:
+        """
+        Parse the line, taking care to handle any container blocks before deciding
+        whether or not to pass the (remaining parts of the) line to the leaf block
+        processor.
+
+        Note: This is one of the more heavily traffic functions in the
+        parser.  Debugging should be uncommented only if needed.
+        """
+
+        grab_bag = ContainerGrabBag(
+            parser_state,
+            container_depth,
+            initial_block_quote_count,
+            adjusted_block_index,
+            container_start_bq_count,
+            parser_properties,
+            ignore_link_definition_start,
+            original_line
+            if original_line is not None
+            else position_marker.text_to_parse,
+            ContainerBlockProcessor.parse_line_for_container_blocks,
+        )
+        (
+            position_marker,
+            did_find_pragma,
+            is_not_in_root_list,
+        ) = ContainerBlockProcessor.__setup(
+            parser_state,
+            position_marker,
+            grab_bag,
+        )
+        if did_find_pragma:
+            return [], None, None, None, False, False
+        # POGGER.debug("position_marker.index_number>>$", position_marker.index_number)
+
+        # POGGER.debug(">>parser_state.token_stack:$", parser_state.token_stack)
+        # POGGER.debug(">>is_not_in_root_list=:$:", is_not_in_root_list)
+        assert grab_bag.extracted_whitespace is not None
+        if (
+            not grab_bag.container_depth
+            and len(grab_bag.extracted_whitespace) >= 4
+            and is_not_in_root_list
+        ):
+            POGGER.debug("indent")
+            ContainerBlockProcessor.__handle_indented_block_start(
+                parser_state, position_marker, grab_bag
+            )
+        else:
+            ContainerBlockNonLeafProcessor.handle_non_leaf_block(
+                parser_state,
+                position_marker,
+                grab_bag,
+            )
+
+        if (
+            grab_bag.can_continue
+            and not grab_bag.do_skip_containers_before_leaf_blocks
+            and not grab_bag.did_blank
+        ) or grab_bag.do_force_leaf_token_parse:
+            ContainerBlockLeafProcessor.handle_leaf_tokens(
+                parser_state,
+                position_marker,
+                grab_bag,
+            )
+
+        return (
+            grab_bag.container_tokens,
+            grab_bag.line_to_parse,
+            grab_bag.block_quote_data.current_count,
+            grab_bag.requeue_line_info,
+            grab_bag.did_blank,
+            grab_bag.do_force_list_continuation,
+        )
+        # pylint: enable=too-many-arguments
+
+    @staticmethod
+    def __handle_indented_block_start(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        (
+            grab_bag.can_continue,
+            grab_bag.line_to_parse,
+            grab_bag.start_index,
+            grab_bag.text_removed_by_container,
+            grab_bag.removed_chars_at_start_of_line,
+        ) = (
+            True,
+            position_marker.text_to_parse,
+            position_marker.index_number,
+            "",
+            0,
+        )
+        POGGER.debug("parser_state.token_stack>>$", parser_state.token_stack)
+        is_paragraph_continuation = (
+            parser_state.token_stack and parser_state.token_stack[-1].is_paragraph
+        )
+        list_index = parser_state.find_last_list_block_on_stack()
+        block_index = parser_state.find_last_block_quote_on_stack()
+        POGGER.debug("list_index>>$", list_index)
+        POGGER.debug("block_index>>$", block_index)
+        if is_paragraph_continuation and block_index > list_index:
+            grab_bag.was_paragraph_continuation = True
+        # if is_paragraph_continuation and block_index < list_index:
+        #     grab_bag.was_other_paragraph_continuation = True
+        if (
+            not is_paragraph_continuation
+            and parser_state.token_stack
+            and len(parser_state.token_stack) >= 2
+            and parser_state.token_stack[1].is_block_quote
+        ):
+            x_tokens, _ = parser_state.close_open_blocks_fn(
+                parser_state,
+                include_lists=True,
+                include_block_quotes=True,
+            )
+            # POGGER.debug("x_tokens=:$:", x_tokens)
+            grab_bag.extend_container_tokens(x_tokens)
+
+    @staticmethod
+    def __prepare_container_start_variables(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> PositionMarker:
+        # POGGER.debug("Stack Depth:$:", parser_state.original_stack_depth)
+        # POGGER.debug("Document Depth:$:", parser_state.original_document_depth)
+        if grab_bag.container_depth:
+            return position_marker
+
+        if ParserHelper.tab_character in position_marker.text_to_parse:
+            detabified_line = TabHelper.detabify_string(position_marker.text_to_parse)
+            POGGER.debug("Before tab replacement:$:", position_marker.text_to_parse)
+            POGGER.debug("After tab replacement :$:", detabified_line)
+            position_marker = PositionMarker(
+                position_marker.line_number,
+                position_marker.index_number,
+                detabified_line,
+                position_marker.index_indent,
+            )
+
+        parser_state.mark_start_information(position_marker)
+
+        parser_state.copy_of_token_stack = []
+        parser_state.copy_of_token_stack.extend(parser_state.token_stack)
+
+        parser_state.block_copy = [
+            copy.deepcopy(i.matching_markdown_token)
+            for i in parser_state.token_stack
+            if not i.is_document
+        ]
+
+        return position_marker
+
+    @staticmethod
+    def __prepare_container_start_variables2(
+        parser_state: ParserState,
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        # Debug to be used for block quotes if needed.
+        # POGGER.debug(
+        #    "Last Block Quote:$:",
+        #    parser_state.last_block_quote_stack_token,
+        # )
+        # POGGER.debug(
+        #    "Last Block Quote:$:",
+        #    parser_state.last_block_quote_markdown_token_index,
+        # )
+        # POGGER.debug(
+        #    "Last Block Quote:$:", parser_state.copy_of_last_block_quote_markdown_token
+        # )
+
+        (
+            new_start_index,
+            grab_bag.extracted_whitespace,
+        ) = ParserHelper.extract_spaces(position_marker.text_to_parse, 0)
+        assert new_start_index is not None
+        grab_bag.start_index = new_start_index
+        ContainerBlockProcessor.__calculate_for_container_blocks(
+            parser_state,
+            grab_bag,
+        )
+
+    @staticmethod
+    def __calculate_for_container_blocks(
+        parser_state: ParserState,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        """
+        Perform some calculations that will be needed for parsing the container blocks.
+        """
+        grab_bag.current_container_blocks = [
+            ind for ind in parser_state.token_stack if ind.is_list
+        ]
+        grab_bag.block_quote_data = BlockQuoteData(
+            0
+            if grab_bag.initial_block_quote_count is None
+            else grab_bag.initial_block_quote_count,
+            parser_state.count_of_block_quotes_on_stack(),
+        )
+
+        ContainerBlockProcessor.__calculate_adjusted_whitespace(
+            parser_state,
+            grab_bag,
+        )
+
+    @staticmethod
+    def __look_back_in_document_for_block_quote(
+        parser_state: ParserState, token_index: int
+    ) -> Optional[BlockQuoteMarkdownToken]:
+        # TODO Look back on stack instead?
+        other_block_quote_token, other_token_index = None, token_index
+        while other_token_index >= 0:
+            if parser_state.token_document[other_token_index].is_block_quote_start:
+                block_quote_token = cast(
+                    BlockQuoteMarkdownToken,
+                    parser_state.token_document[other_token_index],
+                )
+                if not ContainerBlockProcessor.__does_block_quote_token_have_end(
+                    parser_state, block_quote_token
+                ):
+                    other_block_quote_token = block_quote_token
+                    break
+            other_token_index -= 1
+        POGGER.debug_with_visible_whitespace(
+            "PLFCB>>other_block_quote_token>>$",
+            other_block_quote_token,
+        )
+        return other_block_quote_token
+
+    @staticmethod
+    def __calculate_adjusted_whitespace_kludge_without_found(
+        parser_state: ParserState, token_index: int, grab_bag: ContainerGrabBag
+    ) -> Tuple[bool, int]:
+        other_block_quote_token = (
+            ContainerBlockProcessor.__look_back_in_document_for_block_quote(
+                parser_state, token_index
+            )
+        )
+
+        # Check to see if out first block token is the same as our first.
+        # if not, do not use it as a base.
+        #
+        # Note; may need to be tweaked for extra levels.
+        if not grab_bag.container_depth and other_block_quote_token:
+            POGGER.debug(
+                "parser_state.token_stack[1]>>:$:", parser_state.token_stack[1]
+            )
+            if (
+                parser_state.token_stack[1].matching_markdown_token
+                != other_block_quote_token
+            ):
+                other_block_quote_token = None
+
+        if other_block_quote_token:
+            POGGER.debug("PLFCB>>other_block_quote_token>>:$:", other_block_quote_token)
+            POGGER.debug(
+                "PLFCB>>other_block_quote_token.leading_text_index>>:$:",
+                other_block_quote_token.leading_text_index,
+            )
+            leading_spaces = other_block_quote_token.calculate_next_bleading_space_part(
+                increment_index=False, delta=-1
+            )
+            POGGER.debug("PLFCB>>leading_spaces>>:$:", leading_spaces)
+            POGGER.debug("PLFCB>>other_block_quote_token>>:$:", other_block_quote_token)
+            POGGER.debug(
+                "PLFCB>>other_block_quote_token.leading_text_index>>:$:",
+                other_block_quote_token.leading_text_index,
+            )
+            force_reline = True
+            old_start_index = len(leading_spaces)
+        else:
+            force_reline = False
+            list_token = cast(
+                ListStartMarkdownToken, parser_state.token_document[token_index]
+            )
+            old_start_index = list_token.indent_level
+        return force_reline, old_start_index
+
+    @staticmethod
+    def __does_block_quote_token_have_end(
+        parser_state: ParserState,
+        found_block_quote_token: Optional[BlockQuoteMarkdownToken],
+    ) -> bool:
+        assert found_block_quote_token
+        POGGER.debug(
+            "PLFCB>>found_block_quote_token>>:$:",
+            ParserHelper.make_value_visible(found_block_quote_token),
+        )
+        found_token_index = parser_state.token_document.index(found_block_quote_token)
+        POGGER.debug("PLFCB>>found_token_index>>:$:", found_token_index)
+        found_token_index += 1
+        while found_token_index < len(parser_state.token_document):
+            if parser_state.token_document[found_token_index].is_end_token:
+                end_token = cast(
+                    EndMarkdownToken, parser_state.token_document[found_token_index]
+                )
+                if end_token.start_markdown_token == found_block_quote_token:
+                    break
+            found_token_index += 1
+        POGGER.debug(
+            "PLFCB>>found_token_index>>:$:max:$",
+            found_token_index,
+            len(parser_state.token_document),
+        )
+        return found_token_index < len(parser_state.token_document)
+
+    @staticmethod
+    def __calculate_adjusted_whitespace_kludge(
+        parser_state: ParserState,
+        token_index: int,
+        found_block_quote_token: Optional[BlockQuoteMarkdownToken],
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        assert grab_bag.extracted_whitespace is not None
+        previous_ws_len = 0
+        force_reline, ws_len = (
+            False,
+            TabHelper.calculate_length(grab_bag.extracted_whitespace) + previous_ws_len,
+        )
+        if (
+            found_block_quote_token
+            and ContainerBlockProcessor.__does_block_quote_token_have_end(
+                parser_state, found_block_quote_token
+            )
+        ):
+            found_block_quote_token = None
+        if found_block_quote_token:
+            POGGER.debug(
+                "PLFCB>>found_block_quote_token>>:$:",
+                ParserHelper.make_value_visible(found_block_quote_token),
+            )
+            leading_spaces = found_block_quote_token.calculate_next_bleading_space_part(
+                increment_index=False, delta=-1, allow_overflow=True
+            )
+            POGGER.debug("PLFCB>>leading_spaces>>:$:", leading_spaces)
+            old_start_index = len(leading_spaces)
+        else:
+            (
+                force_reline,
+                old_start_index,
+            ) = ContainerBlockProcessor.__calculate_adjusted_whitespace_kludge_without_found(
+                parser_state, token_index, grab_bag
+            )
+        POGGER.debug(
+            "old_start_index>>$>>ws_len>>$>>force_reline>>$",
+            old_start_index,
+            ws_len,
+            force_reline,
+        )
+        if force_reline or ws_len >= old_start_index:
+            POGGER.debug("RELINE:$:", grab_bag.line_to_parse)
+            grab_bag.adj_ws = grab_bag.extracted_whitespace[old_start_index:]
+            POGGER.debug(
+                "adj_ws:$: old_start_index:$:", grab_bag.adj_ws, old_start_index
+            )
+
+    @staticmethod
+    def __look_for_any_list_start(
+        parser_state: ParserState,
+    ) -> Tuple[int, Optional[BlockQuoteMarkdownToken]]:
+        found_block_quote_token: Optional[BlockQuoteMarkdownToken] = None
+        token_index = len(parser_state.token_document) - 1
+        while token_index >= 0 and not (
+            parser_state.token_document[token_index].is_any_list_token
+        ):
+            if (
+                not found_block_quote_token
+                and parser_state.token_document[token_index].is_block_quote_start
+            ):
+                found_block_quote_token = cast(
+                    BlockQuoteMarkdownToken,
+                    parser_state.token_document[token_index],
+                )
+            token_index -= 1
+        POGGER.debug(
+            "PLFCB>>Started list-last token>>$",
+            parser_state.token_document[token_index],
+        )
+
+        POGGER.debug(
+            "CAW>>found_block_quote_token>>:$:",
+            ParserHelper.make_value_visible(found_block_quote_token),
+        )
+        if found_block_quote_token:
+            POGGER.debug(
+                "PLFCB>>leading_text_index>>$",
+                found_block_quote_token.leading_text_index,
+            )
+        assert token_index >= 0
+        return token_index, found_block_quote_token
+
+    @staticmethod
+    def __calculate_adjusted_whitespace(
+        parser_state: ParserState,
+        grab_bag: ContainerGrabBag,
+    ) -> None:
+        """
+        Based on the last container on the stack, determine what the adjusted whitespace is.
+        """
+
+        grab_bag.adj_ws = grab_bag.extracted_whitespace
+        assert grab_bag.adj_ws is not None
+
+        last_block_stack_index = parser_state.find_last_list_block_on_stack()
+        if last_block_stack_index <= 0:
+            assert not grab_bag.current_container_blocks
+            POGGER.debug("PLFCB>>No Started lists")
+            if grab_bag.adjusted_block_index is None:
+                POGGER.debug("PLFCB>>No Started Block Quote")
+            else:
+                POGGER.debug("PLFCB>>Started Block Quote")
+                assert grab_bag.extracted_whitespace is not None
+                grab_bag.adj_ws = grab_bag.extracted_whitespace[
+                    grab_bag.adjusted_block_index :
+                ]
+        else:
+            assert grab_bag.current_container_blocks
+            POGGER.debug(
+                "PLFCB>>Started list-last stack>>$",
+                parser_state.token_stack,
+            )
+            POGGER.debug(
+                "PLFCB>>Started list-last stack>>$",
+                parser_state.token_stack[last_block_stack_index],
+            )
+
+            (
+                token_index,
+                found_block_quote_token,
+            ) = ContainerBlockProcessor.__look_for_any_list_start(parser_state)
+
+            assert grab_bag.adj_ws is not None
+            ContainerBlockProcessor.__calculate_adjusted_whitespace_kludge(
+                parser_state,
+                token_index,
+                found_block_quote_token,
+                grab_bag,
+            )
+            assert grab_bag.adj_ws is not None
+
+    @staticmethod
+    def __look_for_pragmas(
+        position_marker: PositionMarker,
+        grab_bag: ContainerGrabBag,
+    ) -> bool:
+        _, pragma_whitespace = ParserHelper.extract_spaces(
+            position_marker.text_to_parse, 0
+        )
+        return (
+            PragmaExtension.look_for_pragmas(
+                position_marker,
+                position_marker.text_to_parse,
+                grab_bag.container_depth,
+                pragma_whitespace,
+                grab_bag.parser_properties,
+            )
+            if grab_bag.parser_properties.is_pragmas_enabled
+            else False
+        )
+
+
+# pylint: enable=too-few-public-methods
diff --git a/pymarkdown/container_grab_bag.py b/pymarkdown/container_blocks/container_grab_bag.py
similarity index 94%
rename from pymarkdown/container_grab_bag.py
rename to pymarkdown/container_blocks/container_grab_bag.py
index 73413c2a..b0e9b5e9 100644
--- a/pymarkdown/container_grab_bag.py
+++ b/pymarkdown/container_blocks/container_grab_bag.py
@@ -3,14 +3,15 @@ Class to provide a "grab bag" for commonly used properties for the Container Blo
 """
 # pylint: disable=too-many-instance-attributes
 import logging
-from typing import Any, List, Optional
+from typing import Any, Callable, List, Optional, Tuple
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_indices import ContainerIndices
+from pymarkdown.container_blocks.container_indices import ContainerIndices
 from pymarkdown.markdown_token import MarkdownToken
 from pymarkdown.parse_block_pass_properties import ParseBlockPassProperties
 from pymarkdown.parser_logger import ParserLogger
 from pymarkdown.parser_state import ParserState
+from pymarkdown.position_marker import PositionMarker
 from pymarkdown.requeue_line_info import RequeueLineInfo
 from pymarkdown.stack_token import StackToken
 
@@ -35,7 +36,31 @@ class ContainerGrabBag:
         parser_properties: ParseBlockPassProperties,
         ignore_link_definition_start: bool,
         original_line: str,
+        recurse_fn: Callable[
+            [
+                ParserState,
+                PositionMarker,
+                bool,
+                ParseBlockPassProperties,
+                int,
+                int,
+                Optional[int],
+                Optional[int],
+                Optional[str],
+            ],
+            Tuple[
+                List[MarkdownToken],
+                Optional[str],
+                Optional[int],
+                Optional[RequeueLineInfo],
+                bool,
+                bool,
+            ],
+        ],
     ) -> None:
+        # Functions
+        self.__recurse_fn = recurse_fn
+
         # Booleans
         self.__did_blank: bool = False
         self.__was_paragraph_continuation: bool = False
@@ -663,6 +688,34 @@ class ContainerGrabBag:
             self.__log_read_write_value("current_container_blocks", value)
             self.__current_container_blocks = value
 
+    def get_recurse_fn(
+        self,
+    ) -> Callable[
+        [
+            ParserState,
+            PositionMarker,
+            bool,
+            ParseBlockPassProperties,
+            int,
+            int,
+            Optional[int],
+            Optional[int],
+            Optional[str],
+        ],
+        Tuple[
+            List[MarkdownToken],
+            Optional[str],
+            Optional[int],
+            Optional[RequeueLineInfo],
+            bool,
+            bool,
+        ],
+    ]:
+        """
+        xxx
+        """
+        return self.__recurse_fn
+
     def is_leaf_tokens_empty(self) -> bool:
         """
         xxx
diff --git a/pymarkdown/container_helper.py b/pymarkdown/container_blocks/container_helper.py
similarity index 100%
rename from pymarkdown/container_helper.py
rename to pymarkdown/container_blocks/container_helper.py
diff --git a/pymarkdown/container_indices.py b/pymarkdown/container_blocks/container_indices.py
similarity index 100%
rename from pymarkdown/container_indices.py
rename to pymarkdown/container_blocks/container_indices.py
diff --git a/pymarkdown/html/html_helper.py b/pymarkdown/html/html_helper.py
index 5c07c25d..d11462a0 100644
--- a/pymarkdown/html/html_helper.py
+++ b/pymarkdown/html/html_helper.py
@@ -6,7 +6,7 @@ import string
 from typing import List, Optional, Tuple, cast
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_helper import ContainerHelper
+from pymarkdown.container_blocks.container_helper import ContainerHelper
 from pymarkdown.inline_markdown_token import TextMarkdownToken
 from pymarkdown.leaf_markdown_token import HtmlBlockMarkdownToken
 from pymarkdown.markdown_token import MarkdownToken
diff --git a/pymarkdown/html/html_raw_helper.py b/pymarkdown/html/html_raw_helper.py
index 90e9526c..2479ef53 100644
--- a/pymarkdown/html/html_raw_helper.py
+++ b/pymarkdown/html/html_raw_helper.py
@@ -13,8 +13,6 @@ from pymarkdown.parser_logger import ParserLogger
 
 POGGER = ParserLogger(logging.getLogger(__name__))
 
-# pylint: disable=too-many-lines
-
 
 class HtmlRawHelper:
     """
diff --git a/pymarkdown/leaf_blocks/atx_leaf_block_processor.py b/pymarkdown/leaf_blocks/atx_leaf_block_processor.py
index 5bc501dc..9500c848 100644
--- a/pymarkdown/leaf_blocks/atx_leaf_block_processor.py
+++ b/pymarkdown/leaf_blocks/atx_leaf_block_processor.py
@@ -5,7 +5,7 @@ import logging
 from typing import List, Optional, Tuple, cast
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_helper import ContainerHelper
+from pymarkdown.container_blocks.container_helper import ContainerHelper
 from pymarkdown.container_markdown_token import ListStartMarkdownToken
 from pymarkdown.inline_markdown_token import TextMarkdownToken
 from pymarkdown.leaf_blocks.leaf_block_helper import LeafBlockHelper
diff --git a/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py b/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py
index 32134289..3312ad2b 100644
--- a/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py
+++ b/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py
@@ -6,7 +6,7 @@ from typing import List, Optional, Tuple, cast
 
 from pymarkdown.block_quote_data import BlockQuoteData
 from pymarkdown.constants import Constants
-from pymarkdown.container_helper import ContainerHelper
+from pymarkdown.container_blocks.container_helper import ContainerHelper
 from pymarkdown.inline.inline_backslash_helper import InlineBackslashHelper
 from pymarkdown.inline_markdown_token import TextMarkdownToken
 from pymarkdown.leaf_blocks.leaf_block_helper import LeafBlockHelper
diff --git a/pymarkdown/leaf_blocks/leaf_block_processor.py b/pymarkdown/leaf_blocks/leaf_block_processor.py
index 853cd405..903ad4c7 100644
--- a/pymarkdown/leaf_blocks/leaf_block_processor.py
+++ b/pymarkdown/leaf_blocks/leaf_block_processor.py
@@ -4,7 +4,7 @@ Module to provide processing for the leaf blocks.
 import logging
 from typing import List, Optional
 
-from pymarkdown.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
 from pymarkdown.html.html_helper import HtmlHelper
 from pymarkdown.leaf_blocks.atx_leaf_block_processor import AtxLeafBlockProcessor
 from pymarkdown.leaf_blocks.fenced_leaf_block_processor import FencedLeafBlockProcessor
diff --git a/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py b/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py
index 7f76c5bb..58c8aa99 100644
--- a/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py
+++ b/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py
@@ -6,7 +6,7 @@ import logging
 from typing import List, Optional, Tuple
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_helper import ContainerHelper
+from pymarkdown.container_blocks.container_helper import ContainerHelper
 from pymarkdown.leaf_markdown_token import ThematicBreakMarkdownToken
 from pymarkdown.markdown_token import MarkdownToken
 from pymarkdown.parser_helper import ParserHelper
diff --git a/pymarkdown/list_block_processor.py b/pymarkdown/list_block_processor.py
index 81f641c5..e32ce5a1 100644
--- a/pymarkdown/list_block_processor.py
+++ b/pymarkdown/list_block_processor.py
@@ -7,7 +7,7 @@ import string
 from typing import Callable, List, Optional, Tuple, cast
 
 from pymarkdown.block_quote_data import BlockQuoteData
-from pymarkdown.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
 from pymarkdown.container_markdown_token import (
     BlockQuoteMarkdownToken,
     ListStartMarkdownToken,
diff --git a/pymarkdown/tokenized_markdown.py b/pymarkdown/tokenized_markdown.py
index 75ff4990..53aef8fc 100644
--- a/pymarkdown/tokenized_markdown.py
+++ b/pymarkdown/tokenized_markdown.py
@@ -9,7 +9,9 @@ from application_properties import ApplicationProperties
 
 from pymarkdown.bad_tokenization_error import BadTokenizationError
 from pymarkdown.coalesce_processor import CoalesceProcessor
-from pymarkdown.container_block_processor import ContainerBlockProcessor
+from pymarkdown.container_blocks.container_block_processor import (
+    ContainerBlockProcessor,
+)
 from pymarkdown.container_markdown_token import (
     BlockQuoteMarkdownToken,
     ListStartMarkdownToken,


Test patch:
diff --git a/test/basic/test_container_grab_bag.py b/test/basic/test_container_grab_bag.py
index de243bfc..6d8a5b08 100644
--- a/test/basic/test_container_grab_bag.py
+++ b/test/basic/test_container_grab_bag.py
@@ -2,7 +2,7 @@
 Tests for the ContainerGrabBag class.
 """
 
-from pymarkdown.container_grab_bag import ContainerGrabBag
+from pymarkdown.container_blocks.container_grab_bag import ContainerGrabBag
 
 
 def test_initial_do_force_leaf_token_parse():
@@ -12,7 +12,7 @@ def test_initial_do_force_leaf_token_parse():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -29,7 +29,7 @@ def test_change_do_force_leaf_token_parse_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -47,7 +47,7 @@ def test_change_do_force_leaf_token_parse_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -65,7 +65,7 @@ def test_initial_did_indent_processing():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -82,7 +82,7 @@ def test_change_did_indent_processing_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -100,7 +100,7 @@ def test_change_did_indent_processing_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -118,7 +118,7 @@ def test_initial_indent_used_by_container():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -135,7 +135,7 @@ def test_change_indent_used_by_container_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -153,7 +153,7 @@ def test_change_indent_used_by_container_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -171,7 +171,7 @@ def test_initial_indent_already_processed():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -188,7 +188,7 @@ def test_change_indent_already_processed_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -206,7 +206,7 @@ def test_change_indent_already_processed_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -224,7 +224,7 @@ def test_initial_weird_adjusted_text():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -241,7 +241,7 @@ def test_change_weird_adjusted_text_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -259,7 +259,7 @@ def test_change_weird_adjusted_text_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -277,7 +277,7 @@ def test_initial_adj_line_to_parse():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -294,7 +294,7 @@ def test_change_adj_line_to_parse_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -312,7 +312,7 @@ def test_change_adj_line_to_parse_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -330,7 +330,7 @@ def test_initial_last_list_start_index():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -347,7 +347,7 @@ def test_change_last_list_start_index_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -365,7 +365,7 @@ def test_change_last_list_start_index_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -383,7 +383,7 @@ def test_initial_last_block_quote_index():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -400,7 +400,7 @@ def test_change_last_block_quote_index_set_different():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
@@ -418,7 +418,7 @@ def test_change_last_block_quote_index_set_same():
 
     # Arrange
     container_grab_bag = ContainerGrabBag(
-        None, None, None, None, None, None, None, None
+        None, None, None, None, None, None, None, None, None
     )
 
     # Act
diff --git a/test/test_main.py b/test/test_main.py
index 7a88a8f4..4cdbaeef 100644
--- a/test/test_main.py
+++ b/test/test_main.py
@@ -7,7 +7,7 @@ import runpy
 import tempfile
 from test.markdown_scanner import MarkdownScanner
 
-from pymarkdown.container_block_processor import ContainerIndices
+from pymarkdown.container_blocks.container_indices import ContainerIndices
 from pymarkdown.parser_logger import ParserLogger
 from pymarkdown.stack_token import StackToken
 
@@ -1505,7 +1505,7 @@ def test_markdown_logger_arg_list_not_out_of_sync_with_debug():
     new_logger.debug_with_visible_whitespace("one sub $ and one in list", " 1 ")
 
 
-# pylint: disable=broad-except
+# pylint: disable=broad-exception-caught
 def test_markdown_logger_arg_list_out_of_sync():
     """
     Test to verify that if we don't have the same number of
@@ -1528,7 +1528,7 @@ def test_markdown_logger_arg_list_out_of_sync():
         )
 
 
-# pylint: enable=broad-except
+# pylint: enable=broad-exception-caught
 
 
 def test_markdown_with_bad_strict_config_type():