diff --git a/publish/coverage.json b/publish/coverage.json index 05b511ac7..7133420f3 100644 --- a/publish/coverage.json +++ b/publish/coverage.json @@ -2,12 +2,12 @@ "projectName": "pymarkdown", "reportSource": "pytest", "branchLevel": { - "totalMeasured": 5367, - "totalCovered": 5367 + "totalMeasured": 5385, + "totalCovered": 5385 }, "lineLevel": { - "totalMeasured": 21037, - "totalCovered": 21037 + "totalMeasured": 21081, + "totalCovered": 21081 } } diff --git a/publish/pylint_suppression.json b/publish/pylint_suppression.json index 49efbcd81..eb6e37b01 100644 --- a/publish/pylint_suppression.json +++ b/publish/pylint_suppression.json @@ -489,7 +489,7 @@ "too-few-public-methods": 1, "too-many-arguments": 19, "too-many-locals": 3, - "too-many-boolean-expressions": 2 + "too-many-boolean-expressions": 3 }, "pymarkdown/transform_markdown/transform_list_block.py": { "too-many-arguments": 4 @@ -511,7 +511,7 @@ "too-many-arguments": 253, "too-many-locals": 50, "chained-comparison": 2, - "too-many-boolean-expressions": 3, + "too-many-boolean-expressions": 4, "protected-access": 25, "deprecated-decorator": 3, "broad-exception-caught": 3, diff --git a/publish/test-results.json b/publish/test-results.json index 152ea82d9..cffe29c84 100644 --- a/publish/test-results.json +++ b/publish/test-results.json @@ -1364,10 +1364,10 @@ }, { "name": "test.rules.test_md031", - "totalTests": 379, + "totalTests": 653, "failedTests": 0, "errorTests": 0, - "skippedTests": 0, + "skippedTests": 84, "elapsedTimeInMilliseconds": 0 }, { @@ -1620,10 +1620,10 @@ }, { "name": "test.test_markdown_extra", - "totalTests": 177, + "totalTests": 203, "failedTests": 0, "errorTests": 0, - "skippedTests": 1, + "skippedTests": 2, "elapsedTimeInMilliseconds": 0 }, { diff --git a/pymarkdown/container_blocks/container_helper.py b/pymarkdown/container_blocks/container_helper.py index 1dd0c0db8..5121d2b8f 100644 --- a/pymarkdown/container_blocks/container_helper.py +++ b/pymarkdown/container_blocks/container_helper.py @@ -83,16 +83,14 @@ def __reduce_containers_if_required_bq_list( def __xx(parser_state: ParserState, extra_bqs: int) -> List[MarkdownToken]: until_index = len(parser_state.token_stack) - 1 needed_bqs = extra_bqs - while ( - until_index > 0 - and needed_bqs > 0 - and parser_state.token_stack[until_index].is_block_quote - ): + while until_index > 0 and needed_bqs > 0: + if parser_state.token_stack[until_index].is_block_quote: + needed_bqs -= 1 until_index -= 1 - needed_bqs -= 1 x_tokens, _ = parser_state.close_open_blocks_fn( parser_state, include_block_quotes=True, + include_lists=True, was_forced=True, until_this_index=until_index + 1, ) @@ -111,9 +109,10 @@ def __reduce_containers_if_required_bq( extra_bqs: int, ) -> Tuple[bool, str, Optional[str]]: x_tokens = ContainerHelper.__xx(parser_state, extra_bqs) + count_block_quotes = sum(bool(i.is_block_quote_end) for i in x_tokens) assert ( - len(x_tokens) == extra_bqs - ), "Should have generated the requested number of tokens." + count_block_quotes == extra_bqs + ), "Should have generated the requested number of block quote tokens." first_new_token = cast(EndMarkdownToken, x_tokens[0]) diff --git a/pymarkdown/leaf_blocks/atx_leaf_block_processor.py b/pymarkdown/leaf_blocks/atx_leaf_block_processor.py index 563e32a91..92f6c528c 100644 --- a/pymarkdown/leaf_blocks/atx_leaf_block_processor.py +++ b/pymarkdown/leaf_blocks/atx_leaf_block_processor.py @@ -187,6 +187,7 @@ def __parse_atx_heading_found( extracted_whitespace_at_start, extracted_whitespace_at_end, extracted_whitespace_before_end, + block_quote_data, ) return new_tokens @@ -208,6 +209,7 @@ def __parse_atx_heading_add_tokens( extracted_whitespace_at_start: str, extracted_whitespace_at_end: str, extracted_whitespace_before_end: str, + block_quote_data: BlockQuoteData, ) -> List[MarkdownToken]: start_token = AtxHeadingMarkdownToken( hash_count, @@ -222,6 +224,7 @@ def __parse_atx_heading_add_tokens( position_marker.index_indent, old_top_of_stack, new_tokens, + block_quote_data, was_token_already_added_to_stack=False, delay_tab_match=delay_tab_match, ) diff --git a/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py b/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py index 58bfa99ef..e6401d89d 100644 --- a/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py +++ b/pymarkdown/leaf_blocks/fenced_leaf_block_processor.py @@ -438,6 +438,7 @@ def __process_fenced_start( position_marker.index_indent, old_top_of_stack, new_tokens, + block_quote_data, alt_removed_chars_at_start=removed_char_length, original_line=original_line, ) diff --git a/pymarkdown/leaf_blocks/leaf_block_helper.py b/pymarkdown/leaf_blocks/leaf_block_helper.py index 939107ffb..4a7a2b1bc 100644 --- a/pymarkdown/leaf_blocks/leaf_block_helper.py +++ b/pymarkdown/leaf_blocks/leaf_block_helper.py @@ -5,6 +5,7 @@ import logging from typing import List, Optional, Tuple, cast +from pymarkdown.block_quotes.block_quote_data import BlockQuoteData from pymarkdown.general.parser_helper import ParserHelper from pymarkdown.general.parser_logger import ParserLogger from pymarkdown.general.parser_state import ParserState @@ -30,6 +31,7 @@ def correct_for_leaf_block_start_in_list( removed_chars_at_start: int, old_top_of_stack_token: StackToken, html_tokens: List[MarkdownToken], + block_quote_data: BlockQuoteData, was_token_already_added_to_stack: bool = True, delay_tab_match: bool = False, alt_removed_chars_at_start: Optional[int] = None, @@ -83,6 +85,7 @@ def correct_for_leaf_block_start_in_list( delay_tab_match, alt_removed_chars_at_start, is_html, + block_quote_data, original_line, ) @@ -280,22 +283,65 @@ def __detect_list_already_added_to(parser_state: ParserState) -> bool: removed_tokens.append(cast(ListStartMarkdownToken, current_token)) add_index += 1 - if original_removed_tokens: - assert len(original_removed_tokens) == 1 - assert original_removed_tokens[0].is_list_start + assert original_removed_tokens + assert len(original_removed_tokens) == 1 + assert original_removed_tokens[0].is_list_start - original_leading_spaces = original_removed_tokens[0].leading_spaces - current_leading_spaces = removed_tokens[0].leading_spaces - if ( + original_leading_spaces = original_removed_tokens[0].leading_spaces + current_leading_spaces = removed_tokens[0].leading_spaces + return bool( + ( original_leading_spaces and current_leading_spaces and original_leading_spaces != current_leading_spaces - ): - return True - return False + ) + ) # pylint: enable=too-many-locals + @staticmethod + def __handle_leaf_start_inner( + parser_state: ParserState, + removed_chars_at_start: int, + ws_count: int, + html_tokens: List[MarkdownToken], + stack_delta: int, + ) -> Tuple[Optional[ListStackToken], int]: + assert parser_state.token_stack[ + -1 + ].is_list, "Token at the end of the stack must be a list token." + list_stack_token = cast(ListStackToken, parser_state.token_stack[-1]) + + POGGER.debug(">>removed_chars_at_start>>$>>", removed_chars_at_start) + POGGER.debug(">>stack indent>>$>>", list_stack_token.indent_level) + if (removed_chars_at_start + ws_count) >= list_stack_token.indent_level: + return None, stack_delta + tokens_from_close, _ = parser_state.close_open_blocks_fn( + parser_state, + until_this_index=(len(parser_state.token_stack) - 1), + include_lists=True, + ) + POGGER.debug( + ">>correct_for_leaf_block_start_in_list>>tokens_from_close>>$>>", + tokens_from_close, + ) + html_tokens.extend(tokens_from_close) + remaining_stack_index = len(parser_state.token_stack) - 1 + while ( + stack_delta > 0 + and parser_state.token_stack[remaining_stack_index].is_block_quote + ): + stack_delta -= 1 + remaining_stack_index -= 1 + if remaining_stack_index != len(parser_state.token_stack) - 1: + tokens_from_close, _ = parser_state.close_open_blocks_fn( + parser_state, + until_this_index=remaining_stack_index + 1, + include_block_quotes=True, + ) + html_tokens.extend(tokens_from_close) + return list_stack_token, stack_delta + # pylint: disable=too-many-arguments @staticmethod def __handle_leaf_start( @@ -305,6 +351,7 @@ def __handle_leaf_start( delay_tab_match: bool, alt_removed_chars_at_start: Optional[int], is_html: bool, + block_quote_data: BlockQuoteData, original_line: Optional[str] = None, ) -> None: POGGER.debug( @@ -320,30 +367,17 @@ def __handle_leaf_start( parser_state.original_line_to_parse[removed_chars_at_start:], 0 ) + stack_delta = block_quote_data.stack_count - block_quote_data.current_count + adjust_with_leading_spaces = False is_remaining_list_token = True while is_remaining_list_token: - assert parser_state.token_stack[ - -1 - ].is_list, "Token at the end of the stack must be a list token." - list_stack_token = cast(ListStackToken, parser_state.token_stack[-1]) - - POGGER.debug(">>removed_chars_at_start>>$>>", removed_chars_at_start) - POGGER.debug(">>stack indent>>$>>", list_stack_token.indent_level) - if (removed_chars_at_start + ws_count) >= list_stack_token.indent_level: - break # pragma: no cover - - tokens_from_close, _ = parser_state.close_open_blocks_fn( - parser_state, - until_this_index=(len(parser_state.token_stack) - 1), - include_lists=True, + list_stack_token, stack_delta = LeafBlockHelper.__handle_leaf_start_inner( + parser_state, removed_chars_at_start, ws_count, html_tokens, stack_delta ) + if list_stack_token is None: + break adjust_with_leading_spaces = True - POGGER.debug( - ">>correct_for_leaf_block_start_in_list>>tokens_from_close>>$>>", - tokens_from_close, - ) - html_tokens.extend(tokens_from_close) is_remaining_list_token = parser_state.token_stack[-1].is_list POGGER.debug("is_remaining_list_token=$", is_remaining_list_token) diff --git a/pymarkdown/leaf_blocks/leaf_block_processor.py b/pymarkdown/leaf_blocks/leaf_block_processor.py index dacf4e855..e392af5bc 100644 --- a/pymarkdown/leaf_blocks/leaf_block_processor.py +++ b/pymarkdown/leaf_blocks/leaf_block_processor.py @@ -79,6 +79,7 @@ def is_paragraph_ending_leaf_block_start( extracted_whitespace, original_line, index_indent, + skip_whitespace_check=True, ) POGGER.debug( "is_paragraph_ending_leaf_block_start>>is_fenced_code_block>>$", @@ -141,6 +142,7 @@ def handle_html_block( position_marker.index_indent, old_top_of_stack, html_tokens, + grab_bag.block_quote_data, alt_removed_chars_at_start=alt_removed_chars_at_start, is_html=True, original_line=grab_bag.original_line, diff --git a/pymarkdown/leaf_blocks/setext_leaf_block_processor.py b/pymarkdown/leaf_blocks/setext_leaf_block_processor.py index 240827ebe..6410ba5b1 100644 --- a/pymarkdown/leaf_blocks/setext_leaf_block_processor.py +++ b/pymarkdown/leaf_blocks/setext_leaf_block_processor.py @@ -130,6 +130,7 @@ def parse_setext_headings( ex_ws_l, split_tab_with_block_quote_suffix, extra_whitespace_prefix, + block_quote_data, ) else: POGGER.debug( @@ -150,6 +151,7 @@ def __prepare_and_create_setext_token( ex_ws_l: int, split_tab_with_block_quote_suffix: bool, extra_whitespace_prefix: Optional[str], + block_quote_data: BlockQuoteData, ) -> Tuple[int, int, str]: _, collected_to_index = ParserHelper.collect_while_character_verified( line_to_parse, @@ -189,6 +191,7 @@ def __prepare_and_create_setext_token( extra_whitespace_prefix, old_top_of_stack, new_tokens, + block_quote_data, ) return collected_to_index, after_whitespace_index, extra_whitespace_after_setext @@ -203,6 +206,7 @@ def __prepare_and_create_setext_token_list_adjust( extra_whitespace_prefix: Optional[str], old_top_of_stack: StackToken, new_tokens: List[MarkdownToken], + block_quote_data: BlockQuoteData, ) -> None: POGGER.debug("parser_state.token_stack[-1]>>:$:<", parser_state.token_stack[-1]) POGGER.debug("parser_state.token_stack>>:$:<", parser_state.token_stack) @@ -221,6 +225,7 @@ def __prepare_and_create_setext_token_list_adjust( position_marker.index_indent, old_top_of_stack, new_tokens, + block_quote_data, was_token_already_added_to_stack=False, delay_tab_match=True, ) diff --git a/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py b/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py index a85b88a02..2e489e202 100644 --- a/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py +++ b/pymarkdown/leaf_blocks/thematic_leaf_block_processor.py @@ -176,21 +176,24 @@ def __handle_special_case( last_list_markdown_token = cast( ListStartMarkdownToken, list_end_token.start_markdown_token ) - inner_list_markdown_token = cast( - ListStartMarkdownToken, - parser_state.token_stack[stack_index].matching_markdown_token, - ) - leading_space_to_move = ( - last_list_markdown_token.remove_last_leading_space() - ) - assert leading_space_to_move is not None - POGGER.debug( - "__handle_special_case>>list_token>>$", inner_list_markdown_token - ) - inner_list_markdown_token.add_leading_spaces(leading_space_to_move) - POGGER.debug( - "__handle_special_case>>list_token>>$", inner_list_markdown_token - ) + if last_list_markdown_token.leading_spaces is not None: + inner_list_markdown_token = cast( + ListStartMarkdownToken, + parser_state.token_stack[stack_index].matching_markdown_token, + ) + leading_space_to_move = ( + last_list_markdown_token.remove_last_leading_space() + ) + assert leading_space_to_move is not None + POGGER.debug( + "__handle_special_case>>list_token>>$", + inner_list_markdown_token, + ) + inner_list_markdown_token.add_leading_spaces(leading_space_to_move) + POGGER.debug( + "__handle_special_case>>list_token>>$", + inner_list_markdown_token, + ) @staticmethod def parse_thematic_break( @@ -303,6 +306,7 @@ def __perform_adjusts( new_tokens, start_char, token_text, + block_quote_data, ) else: split_tab, extracted_whitespace, whitespace_prefix = ( @@ -330,6 +334,7 @@ def __parse_thematic_break_with_suffix( new_tokens: List[MarkdownToken], start_char: str, token_text: str, + block_quote_data: BlockQuoteData, ) -> None: POGGER.debug("parser_state.token_stack[-1]>>:$:<", parser_state.token_stack[-1]) POGGER.debug("parser_state.token_stack>>:$:<", parser_state.token_stack) @@ -350,6 +355,7 @@ def __parse_thematic_break_with_suffix( position_marker.index_indent, old_top_of_stack, new_tokens, + block_quote_data, was_token_already_added_to_stack=False, delay_tab_match=True, ) diff --git a/pymarkdown/transform_markdown/transform_containers.py b/pymarkdown/transform_markdown/transform_containers.py index 725d64d99..9c95cadb7 100644 --- a/pymarkdown/transform_markdown/transform_containers.py +++ b/pymarkdown/transform_markdown/transform_containers.py @@ -341,7 +341,32 @@ def __apply_line_transformation_check( # pylint: enable=too-many-arguments - # pylint: disable=too-many-arguments + @staticmethod + def __abcd_inner( + removed_tokens: List[MarkdownToken], removed_token_indices: List[int] + ) -> bool: + do_check = True + if removed_tokens[0].is_list_start: + current_leading_spaces = cast( + ListStartMarkdownToken, removed_tokens[0] + ).leading_spaces + else: + bq_token = cast(BlockQuoteMarkdownToken, removed_tokens[0]) + current_leading_spaces = bq_token.bleading_spaces + do_check = bq_token.weird_kludge_five + if do_check: + split_space_index = ( + len(current_leading_spaces.split("\n")) + if current_leading_spaces is not None + else 0 + ) + if split_space_index != removed_token_indices[0]: + return True + del removed_tokens[0] + del removed_token_indices[0] + return False + + # pylint: disable=too-many-arguments, too-many-boolean-expressions @staticmethod def __abcd( current_changed_record: Optional[MarkdownChangeRecord], @@ -352,6 +377,17 @@ def __abcd( container_token_indices: List[int], ) -> Optional[str]: prefix = None + + if ( + len(container_stack) == 1 + and len(removed_tokens) == 3 + and container_stack[0].is_block_quote_start + and removed_tokens[0].is_block_quote_start + and removed_tokens[1].is_list_start + and removed_tokens[2].is_block_quote_start + ): + return "" + assert current_changed_record is not None token_to_match = ( current_changed_record.item_c @@ -371,26 +407,10 @@ def __abcd( ): token_index += 1 assert token_index != len(actual_tokens) - while removed_tokens: - do_check = True - if removed_tokens[0].is_list_start: - current_leading_spaces = cast( - ListStartMarkdownToken, removed_tokens[0] - ).leading_spaces - else: - bq_token = cast(BlockQuoteMarkdownToken, removed_tokens[0]) - current_leading_spaces = bq_token.bleading_spaces - do_check = bq_token.weird_kludge_five - if do_check: - split_space_index = ( - len(current_leading_spaces.split("\n")) - if current_leading_spaces is not None - else 0 - ) - if split_space_index != removed_token_indices[0]: - break - del removed_tokens[0] - del removed_token_indices[0] + while removed_tokens and not TransformContainers.__abcd_inner( + removed_tokens, removed_token_indices + ): + pass keep_going = len(removed_tokens) > 1 if keep_going: prefix = TransformContainers.__abcd_final( @@ -398,14 +418,45 @@ def __abcd( container_token_indices, removed_tokens, removed_token_indices, - prefix, ) keep_going = len(removed_tokens) <= 1 assert keep_going return prefix - # pylint: enable=too-many-arguments + # pylint: enable=too-many-arguments, too-many-boolean-expressions + + @staticmethod + def __abcd_final_list( + removed_tokens: List[MarkdownToken], removed_token_indices: List[int] + ) -> Optional[str]: + removed_list_token = cast(ListStartMarkdownToken, removed_tokens[0]) + assert removed_list_token.leading_spaces is not None + split_leading_spaces = removed_list_token.leading_spaces.split("\n") + # TODO figure out way to do this properly here instead of relying on + # prefix is None for most cases + possible_prefix = None + if ( + removed_token_indices[0] < len(split_leading_spaces) + and split_leading_spaces[removed_token_indices[0]] + ): + possible_prefix = split_leading_spaces[removed_token_indices[0]] + del removed_tokens[0] + del removed_token_indices[0] + + prefix = None + if removed_tokens[0].is_block_quote_start: + removed_block_quote_token = cast(BlockQuoteMarkdownToken, removed_tokens[0]) + assert removed_block_quote_token.bleading_spaces is not None + split_bleading_spaces = removed_block_quote_token.bleading_spaces.split( + "\n" + ) + assert removed_token_indices[0] < len(split_bleading_spaces) + prefix = "" if possible_prefix is None else possible_prefix + prefix = f"{split_bleading_spaces[removed_token_indices[0]]}{prefix}" + del removed_tokens[0] + del removed_token_indices[0] + return prefix @staticmethod def __abcd_final( @@ -413,13 +464,13 @@ def __abcd_final( container_token_indices: List[int], removed_tokens: List[MarkdownToken], removed_token_indices: List[int], - prefix: Optional[str], ) -> Optional[str]: container_stack_copy = container_stack[:] container_indices_copy = container_token_indices[:] container_stack_copy.extend(removed_tokens[::-1]) container_indices_copy.extend(removed_token_indices[::-1]) + prefix = None if container_stack_copy[-1].is_block_quote_start: # Temporary until we have more data. test_extra_047f6x @@ -454,10 +505,9 @@ def __abcd_final( del removed_tokens[0] del removed_token_indices[0] else: - del removed_tokens[0] - del removed_token_indices[0] - del removed_tokens[0] - del removed_token_indices[0] + prefix = TransformContainers.__abcd_final_list( + removed_tokens, removed_token_indices + ) return prefix # pylint: disable=too-many-locals @@ -1357,14 +1407,18 @@ def __adjust_for_list_end_part_3( and nested_block_start_index ): assert token_stack[nested_block_start_index].is_block_quote_start - new_start_index = nested_block_start_index - 1 - while ( - new_start_index >= 0 - and not token_stack[new_start_index].is_block_quote_start - ): - new_start_index -= 1 - if new_start_index >= 0: - container_token_indices[new_start_index] += 1 + block_quote_token = cast( + BlockQuoteMarkdownToken, token_stack[nested_block_start_index] + ) + if not block_quote_token.weird_kludge_three: + new_start_index = nested_block_start_index - 1 + while ( + new_start_index >= 0 + and not token_stack[new_start_index].is_block_quote_start + ): + new_start_index -= 1 + if new_start_index >= 0: + container_token_indices[new_start_index] += 1 # pylint: enable=too-many-arguments diff --git a/test/gfm/test_markdown_whitespace_fenced.py b/test/gfm/test_markdown_whitespace_fenced.py index 0e413aec3..7720326a9 100644 --- a/test/gfm/test_markdown_whitespace_fenced.py +++ b/test/gfm/test_markdown_whitespace_fenced.py @@ -1054,10 +1054,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: :]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,5):`:3:python::::\t:]", "[text(4,1):abc:\a\t\a\x03\a]", @@ -1095,10 +1095,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: :]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,5):`:3:python::::\t:]", "[text(4,1):abc:\a\t\a\x03\a]", @@ -1216,10 +1216,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: :]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,6):`:3:python::::\t :]", "[text(4,1):abc:\a\t \a\x03\a]", @@ -1257,10 +1257,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: :]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,6):`:3:python::::\t :]", "[text(4,1):abc:\a\t \a\x03\a]", @@ -1297,10 +1297,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: : ]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,5):`:3:python::::\t:]", "[text(4,1):abc:\a \t\a\x03\a]", @@ -1338,10 +1338,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: : ]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,5):`:3:python::::\t:]", "[text(4,1):abc:\a \t\a\x03\a]", @@ -1378,10 +1378,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: :]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,5):`:3:python:::: :]", "[text(4,4):abc:\a \a\x03\a]", @@ -1419,10 +1419,10 @@ def test_whitespaces_fenced_code_open_with_tabs_before_within_ordered_double_lis "[para(1,4):]", "[text(1,4):abc:]", "[end-para:::True]", - "[olist(2,4):.:1:6: :]", + "[olist(2,4):.:1:6: ]", "[para(2,7):]", "[text(2,7):def:]", - "[end-para:::False]", + "[end-para:::True]", "[end-olist:::True]", "[fcode-block(3,5):`:3:python:::: :]", "[text(4,4):abc:\a \a\x03\a]", diff --git a/test/nested_three/test_markdown_nested_three_unordered_unordered_unordered.py b/test/nested_three/test_markdown_nested_three_unordered_unordered_unordered.py index 8bf0777d4..8be96b5de 100644 --- a/test/nested_three/test_markdown_nested_three_unordered_unordered_unordered.py +++ b/test/nested_three/test_markdown_nested_three_unordered_unordered_unordered.py @@ -1136,10 +1136,10 @@ def test_nested_three_unordered_unordered_nl_unordered_drop_list_with_fenced(): "[end-ulist:::True]", "[li(2,1):2::]", "[ulist(2,3):+::4: : \n \n \n]", - "[ulist(2,5):+::6: : \n]", + "[ulist(2,5):+::6: : ]", "[para(2,7):\n]", "[text(2,7):list 2.1\nlist 2.2::\n]", - "[end-para:::False]", + "[end-para:::True]", "[end-ulist:::True]", "[fcode-block(4,5):`:3:block:::::]", "[text(5,5):A code block:]", diff --git a/test/rules/test_md031.py b/test/rules/test_md031.py index 37b926bdd..b99e3eef7 100644 --- a/test/rules/test_md031.py +++ b/test/rules/test_md031.py @@ -634,6 +634,29 @@ > ``` > > This is a blank line and some text. +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_with_previous_inner_block_double_drop", + source_file_contents="""> > inner block +> > inner block +```block +A code block +``` +This is a blank line and some text. +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:3:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + fix_expected_file_contents="""> > inner block +> > inner block + +```block +A code block +``` + +This is a blank line and some text. """, ), pluginRuleTest( @@ -667,7 +690,6 @@ "bad_fenced_block_in_block_quote_with_previous_inner_block_with_thematics", source_file_contents="""> > inner block > > inner block -> > ___ > ```block > A code block @@ -677,12 +699,11 @@ """, disable_rules="md022,md026", scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, fix_expected_file_contents="""> > inner block > > inner block -> > ___ > > ```block @@ -691,6 +712,34 @@ > > ___ >This is a blank line and some text. +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_with_previous_inner_block_double_drop_with_thematics", + source_file_contents="""> > inner block +> > inner block +___ +```block +A code block +``` +___ +This is a blank line and some text. +""", + disable_rules="md022,md026", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + fix_expected_file_contents="""> > inner block +> > inner block +___ + +```block +A code block +``` + +___ +This is a blank line and some text. """, ), pluginRuleTest( @@ -746,6 +795,31 @@ > A code block > ``` > +> This is a blank line and some text. +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_with_previous_inner_list_double_drop", + source_file_contents="""> + inner list +> + inner list +```block +A code block +``` +This is a blank line and some text. +""", + disable_rules="md032", + mark_fix_as_skipped=True, + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:3:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + fix_expected_file_contents="""> + inner list +> + inner list + +> ```block +> A code block +> ``` + > This is a blank line and some text. """, ), @@ -802,6 +876,34 @@ > > ___ >This is a blank line and some text. +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_with_previous_inner_list_double_drop_with_thematics", + source_file_contents="""> + inner list +> + inner list +___ +```block +A code block +``` +___ +This is a blank line and some text. +""", + disable_rules="md022,md026,md032", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + fix_expected_file_contents="""> + inner list +> + inner list +___ + +```block +A code block +``` + +___ +This is a blank line and some text. """, ), pluginRuleTest( @@ -1481,6 +1583,33 @@ ``` + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_with_previous_inner_block_double_drop", + source_file_contents="""+ list + > inner list + > couple of lines +```block +A code block +``` +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ list + > inner list + > couple of lines + +```block +A code block +``` + +another list """, ), pluginRuleTest( @@ -1511,6 +1640,36 @@ ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_with_previous_inner_block_double_drop_with_thematics", + source_file_contents="""+ list + > inner list + > couple of lines +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ list + > inner list + > couple of lines +----- + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( @@ -1573,6 +1732,32 @@ ``` + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_with_previous_inner_list_double_drop", + source_file_contents="""+ list + + inner list + couple of lines +```block +A code block +``` +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ list + + inner list + couple of lines + +```block +A code block +``` + +another list """, ), pluginRuleTest( # test_extra_047c0 test_extra_047c1 @@ -1603,6 +1788,36 @@ ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_with_previous_inner_list_double_drop_with_thematics", + source_file_contents="""+ list + + inner list + couple of lines +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ list + + inner list + couple of lines +----- + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( @@ -1869,6 +2084,28 @@ > > ``` > > > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_double_drop", + source_file_contents="""> > -------- +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:2:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > -------- + +```block +A code block +``` + +-------- """, ), pluginRuleTest( @@ -1933,6 +2170,59 @@ > > ```block > > A code block > > ``` +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_double_drop_with_previous_inner_block", + source_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +> ```block +> A code block +> ``` +> text +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +> +> ```block +> A code block +> ``` +> +> text +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_triple_drop_with_previous_inner_block", + source_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +```block +A code block +``` +text +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 + +```block +A code block +``` + +text """, ), pluginRuleTest( # test_extra_044x test_extra_044a @@ -1964,18 +2254,74 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_block_with_setext", + "bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_block_double_drop_with_thematics", source_file_contents="""> > > block 3 > > > block 3 > > > block 3 -> > -> > abc -> > -------- -> > ```block -> > A code block -> > ``` -> > abc -> > -------- +> -------- +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +> -------- +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_block_triple_drop_with_thematics", + source_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +-------- +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +-------- + +```block +A code block +``` + +-------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_block_with_setext", + source_file_contents="""> > > block 3 +> > > block 3 +> > > block 3 +> > +> > abc +> > -------- +> > ```block +> > A code block +> > ``` +> > abc +> > -------- """, scan_expected_return_code=1, scan_expected_output="""{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) @@ -2105,6 +2451,59 @@ > > ``` > > > > -------- +""", + ), + pluginRuleTest( # test_extra_049l0 + "bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_list_double_drop", + source_file_contents="""> > + block 3 +> > block 3 +> > + block 3 +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + block 3 +> > block 3 +> > + block 3 +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_list_triple_drop", + source_file_contents="""> > + block 3 +> > block 3 +> > + block 3 +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > + block 3 +> > block 3 +> > + block 3 + +```block +A code block +``` + +-------- """, ), pluginRuleTest( # test_extra_044lx test_nested_three_block_block_unordered_drop_list_after_new_list_and_text_with_thematic_and_fenced_with_blanks @@ -2235,6 +2634,86 @@ > > > ``` > > > > > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_double_drop", + source_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> > ```block +> > A code block +> > ``` +> > -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> > +> > ```block +> > A code block +> > ``` +> > +> > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_triple_drop", + source_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_quad_drop", + source_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + fix_expected_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 + +```block +A code block +``` + +-------- """, ), pluginRuleTest( # test_extra_044ma @@ -2263,6 +2742,91 @@ > > > ``` > > > > > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_double_drop_with_thematics", + source_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> > -------- +> > ```block +> > A code block +> > ``` +> > -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + fix_expected_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> > -------- +> > +> > ```block +> > A code block +> > ``` +> > +> > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_triple_drop_with_thematics", + source_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> -------- +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +> -------- +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_quad_drop_with_thematics", + source_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +-------- +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + fix_expected_file_contents="""> > > +> > > > fourth block 1 +> > > > fourth block 2 +-------- + +```block +A code block +``` + +-------- """, ), pluginRuleTest( @@ -2327,31 +2891,117 @@ > > > -------- """, ), - pluginRuleTest( # test_extra_044mcy0 - "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_with_thematics", + pluginRuleTest( # test_extra_049l1 + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_double_drop", source_file_contents="""> > > > > > + inner list 1 > > > inner list 2 > > > + inner list 3 -> > > -------- -> > > ```block -> > > A code block -> > > ``` -> > > -------- +> > ```block +> > A code block +> > ``` +> > -------- """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""> > > > > > + inner list 1 > > > inner list 2 > > > + inner list 3 -> > > -------- -> > > -> > > ```block -> > > A code block +> > +> > ```block +> > A code block +> > ``` +> > +> > -------- +""", + ), + pluginRuleTest( # test_extra_049l2 + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_triple_drop", + source_file_contents="""> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_quad_drop", + source_file_contents="""> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 + +```block +A code block +``` + +-------- +""", + ), + pluginRuleTest( # test_extra_044mcy0 + "bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_with_thematics", + source_file_contents="""> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +> > > -------- +> > > ```block +> > > A code block +> > > ``` +> > > -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +> > > -------- +> > > +> > > ```block +> > > A code block > > > ``` > > > > > > -------- @@ -2460,6 +3110,90 @@ > > ``` > > > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_double_drop", + source_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> > ```block +> > A code block +> > ``` +> > -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> > +> > ```block +> > A code block +> > ``` +> > +> > -------- +""", + ), + pluginRuleTest( # test_extra_049b0 + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_triple_drop", + source_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( # test_extra_049c0 + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_quad_drop", + source_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + -------- +> > > block 1 +> > > block 2 + +```block +A code block +``` + +-------- """, ), pluginRuleTest( # test_extra_047h0 test_extra_047h1 @@ -2488,6 +3222,94 @@ > > ``` > > > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_double_drop_with_thematics", + source_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> > -------- +> > ```block +> > A code block +> > ``` +> > -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> > -------- +> > +> > ```block +> > A code block +> > ``` +> > +> > -------- +""", + ), + pluginRuleTest( # test_extra_049b1 + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_triple_drop_with_thematics", + source_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> -------- +> ```block +> A code block +> ``` +> -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> > -------- +> +> ```block +> A code block +> ``` +> +> -------- +""", + ), + pluginRuleTest( # test_extra_049c1 + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_quad_drop_with_thematics", + source_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +-------- +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + -------- +> > > block 1 +> > > block 2 +> > -------- + +```block +A code block +``` + +-------- """, ), pluginRuleTest( @@ -2552,46 +3374,223 @@ > > ______ """, ), - pluginRuleTest( # test_extra_044lex1 test_extra_044lex1a - "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_and_thematics", + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_double_drop", source_file_contents="""> > + ______ > > + list 1 > > list 2 > > + list 3 -> > ______ -> > ```block -> > A code block -> > ``` -> > ______ +> > ```block +> > A code block +> > ``` +> > ______ """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032,md035", + mark_fix_as_skipped=True, fix_expected_file_contents="""> > + ______ > > + list 1 > > list 2 > > + list 3 -> > ______ > > -> > ```block -> > A code block -> > ``` +> > ```block +> > A code block +> > ``` > > -> > ______ +> > ______ """, ), - pluginRuleTest( - "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_and_setext", + pluginRuleTest( # test_extra_049l3 + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_triple_drop", source_file_contents="""> > + ______ > > + list 1 > > list 2 > > + list 3 -> > -> > abc -> > ----- -> > ```block +> ```block +> A code block +> ``` +> ______ +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md035", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> +> ```block +> A code block +> ``` +> +> ______ +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_quad_drop", + source_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +```block +A code block +``` +______ +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md035", + fix_expected_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 + +```block +A code block +``` + +______ +""", + ), + pluginRuleTest( # test_extra_044lex1 test_extra_044lex1a + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_and_thematics", + source_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> > ______ +> > ```block +> > A code block +> > ``` +> > ______ +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md035", + fix_expected_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> > ______ +> > +> > ```block +> > A code block +> > ``` +> > +> > ______ +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_double_drop_and_thematics", + source_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> > ______ +> > ```block +> > A code block +> > ``` +> > ______ +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md035", + fix_expected_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> > ______ +> > +> > ```block +> > A code block +> > ``` +> > +> > ______ +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_triple_drop_and_thematics", + source_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> ______ +> ```block +> A code block +> ``` +> ______ +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md035", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> ______ +> +> ```block +> A code block +> ``` +> +> ______ +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_quad_drop_and_thematics", + source_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +______ +```block +A code block +``` +______ +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md035", + fix_expected_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +______ + +```block +A code block +``` + +______ +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_and_setext", + source_file_contents="""> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> > +> > abc +> > ----- +> > ```block > > A code block > > ``` > > abc @@ -2706,6 +3705,59 @@ > ``` > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_block_double_drop", + source_file_contents="""1. > > + > > block 3 + > > block 3 + ```block + A code block + ``` + -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > + > > block 3 + > > block 3 + + ```block + A code block + ``` + + -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_block_triple_drop", + source_file_contents="""1. > > + > > block 3 + > > block 3 +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > + > > block 3 + > > block 3 + +```block +A code block +``` + +-------- """, ), pluginRuleTest( @@ -2734,6 +3786,62 @@ > ``` > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_block_double_drop_with_thematics", + source_file_contents="""1. > > + > > block 3 + > > block 3 + -------- + ```block + A code block + ``` + -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > + > > block 3 + > > block 3 + -------- + + ```block + A code block + ``` + + -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_block_triple_drop_with_thematics", + source_file_contents="""1. > > + > > block 3 + > > block 3 +-------- +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > + > > block 3 + > > block 3 +-------- + +```block +A code block +``` + +-------- """, ), pluginRuleTest( @@ -2884,31 +3992,140 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_with_thematics", + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_double_drop", source_file_contents="""1. > + > list 3 > + list 3 - > -------- - > ```block - > A code block - > ``` - > -------- + ```block + A code block + ``` + -------- """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", fix_expected_file_contents="""1. > + > list 3 > + list 3 - > -------- - > - > ```block - > A code block - > ``` + + ```block + A code block + ``` + + -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_triple_drop", + source_file_contents="""1. > + + > list 3 + > + list 3 +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + + > list 3 + > + list 3 + +```block +A code block +``` + +-------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_with_thematics", + source_file_contents="""1. > + + > list 3 + > + list 3 + > -------- + > ```block + > A code block + > ``` + > -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > + + > list 3 + > + list 3 + > -------- + > + > ```block + > A code block + > ``` > > -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_double_drop_with_thematics", + source_file_contents="""1. > + + > list 3 + > + list 3 + -------- + ```block + A code block + ``` + -------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > + + > list 3 + > + list 3 + -------- + + ```block + A code block + ``` + + -------- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_triple_drop_with_thematics", + source_file_contents="""1. > + + > list 3 + > + list 3 +-------- +```block +A code block +``` +-------- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > + + > list 3 + > + list 3 +-------- + +```block +A code block +``` + +-------- """, ), pluginRuleTest( @@ -2985,6 +4202,219 @@ > > ``` > > > > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_block", + source_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + > > ```block + > > A code block + > > ``` + > > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + > > + > > ```block + > > A code block + > > ``` + > > + > > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_block_double_drop", + source_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_block_triple_drop", + source_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_block_quad_drop", + source_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > > block 1 + > > > block 2 + +```block +A code block +``` + +---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list", + source_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + > > ```block + > > A code block + > > ``` + > > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + > > + > > ```block + > > A code block + > > ``` + > > + > > ---- +""", + ), + pluginRuleTest( # test_extra_049l5 + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list_double_drop", + source_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list_triple_drop", + source_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list_quad_drop", + source_file_contents="""1. > > ---- + > > + block 1 + > > block 2 +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + block 1 + > > block 2 + +```block +A code block +``` + +---- """, ), pluginRuleTest( # test_extra_044mx2 @@ -3037,19 +4467,103 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_2", + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_double_drop", source_file_contents="""1. > + ---- > > block 1 > > block 2 - > ---- - > ```block - > A code block - > ``` - > ---- + > ```block + > A code block + > ``` + > ---- """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > > block 1 + > > block 2 + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( # test_extra_049g0 + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_triple_drop", + source_file_contents="""1. > + ---- + > > block 1 + > > block 2 + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > > block 1 + > > block 2 + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( # test_extra_049f0 + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_quad_drop", + source_file_contents="""1. > + ---- + > > block 1 + > > block 2 +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > > block 1 + > > block 2 + +```block +A code block +``` + +---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_2", + source_file_contents="""1. > + ---- + > > block 1 + > > block 2 + > ---- + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032,md027", fix_expected_file_contents="""1. > + ---- @@ -3146,6 +4660,92 @@ > ``` > > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_double_drop", + source_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_triple_drop", + source_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_quad_drop", + source_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + +```block +A code block +``` + +---- """, ), pluginRuleTest( # test_extra_046n0 test_extra_046n1 @@ -3176,6 +4776,100 @@ > ``` > > ---- +""", + ), + pluginRuleTest( # test_extra_049a0 + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_double_drop_with_thematics", + source_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + > ---- + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + > ---- + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_triple_drop_with_thematics", + source_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + ---- + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + > ---- + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_quad_drop_with_thematics", + source_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 +---- +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > + ---- + > + list 1 + > list 2 + > + list 3 + > ---- + +```block +A code block +``` + +---- """, ), pluginRuleTest( @@ -3240,36 +4934,202 @@ > > ---- """, ), - pluginRuleTest( # test_extra_046k0 test_extra_046k1 - "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_with_thematics", + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_double_drop", source_file_contents="""1. > > ---- > > > inner block 1 > > > inner block 2 - > > ---- - > > ```block - > > A code block - > > ``` - > > ---- + > ```block + > A code block + > ``` + > ---- """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""1. > > ---- > > > inner block 1 > > > inner block 2 - > > ---- - > > - > > ```block - > > A code block - > > ``` - > > - > > ---- + > + > ```block + > A code block + > ``` + > + > ---- """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_with_setext", + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_triple_drop", + source_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_quad_drop", + source_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + +```block +A code block +``` + +---- +""", + ), + pluginRuleTest( # test_extra_046k0 test_extra_046k1 + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_with_thematics", + source_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + > > ---- + > > ```block + > > A code block + > > ``` + > > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + > > ---- + > > + > > ```block + > > A code block + > > ``` + > > + > > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_double_drop_with_thematics", + source_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + > ---- + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + > ---- + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_triple_drop_with_thematics", + source_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + ---- + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + > ---- + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_quad_drop_with_thematics", + source_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 +---- +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > > inner block 1 + > > > inner block 2 + > ---- + +```block +A code block +``` + +---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_with_setext", source_file_contents="""1. > > ---- > > > inner block 1 > > > inner block 2 @@ -3328,6 +5188,93 @@ > > ``` > > > > ---- +""", + ), + pluginRuleTest( # test_extra_049l6 + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_double_drop", + source_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + > ```block + > A code block + > ``` + > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_triple_drop", + source_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_quad_drop", + source_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + +```block +A code block +``` + +---- """, ), pluginRuleTest( # test_extra_046h0 test_extra_046h1 @@ -3361,39 +5308,131 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_with_setext", + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_double_drop_with_thematics", source_file_contents="""1. > > ---- > > + list 1 > > list 2 > > + list 3 - > > - > > abc - > > ---- - > > ```block - > > A code block - > > ``` - > > abc - > > ---- + > ---- + > ```block + > A code block + > ``` + > ---- """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:8:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:10:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:6: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, - disable_rules="md032,md022,md024", + disable_rules="md032,md027", + mark_fix_as_skipped=True, fix_expected_file_contents="""1. > > ---- > > + list 1 > > list 2 > > + list 3 - > > - > > abc - > > ---- - > > - > > ```block - > > A code block - > > ``` - > > - > > abc - > > ---- + > ---- + > + > ```block + > A code block + > ``` + > + > ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_triple_drop_with_thematics", + source_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + ---- + ```block + A code block + ``` + ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:4: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + ---- + + ```block + A code block + ``` + + ---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_quad_drop_with_thematics", + source_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 +---- +```block +A code block +``` +---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 +---- + +```block +A code block +``` + +---- +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_with_setext", + source_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + > > + > > abc + > > ---- + > > ```block + > > A code block + > > ``` + > > abc + > > ---- +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:8:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:10:8: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md022,md024", + fix_expected_file_contents="""1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + > > + > > abc + > > ---- + > > + > > ```block + > > A code block + > > ``` + > > + > > abc + > > ---- """, ), pluginRuleTest( @@ -3512,6 +5551,68 @@ > > ------ > + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_double_drop", + source_file_contents="""> + list 1 +> > block 2 +> > block 3 +> ------ +> ```block +> A code block +> ``` +> ------ +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + fix_expected_file_contents="""> + list 1 +> > block 2 +> > block 3 +> ------ +> +> ```block +> A code block +> ``` +> +> ------ +> another list +""", + ), + pluginRuleTest( # test_extra_049k0 + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_triple_drop", + source_file_contents="""> + list 1 +> > block 2 +> > block 3 +------ +```block +A code block +``` +------ +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> + list 1 +> > block 2 +> > block 3 +------ + +```block +A code block +``` + +------ +another list """, ), pluginRuleTest( # test_extra_046g0 test_extra_046g1 @@ -3538,6 +5639,60 @@ > ``` > > + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_double_drop_without_thematics", + source_file_contents="""> + list 1 +> > block 2 +> > block 3 +> ```block +> A code block +> ``` +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + list 1 +> > block 2 +> > block 3 +> +> ```block +> A code block +> ``` +> +> another list +""", + ), + pluginRuleTest( # test_extra_049k1 + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_triple_drop_without_thematics", + source_file_contents="""> + list 1 +> > block 2 +> > block 3 +```block +A code block +``` +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + list 1 +> > block 2 +> > block 3 + +```block +A code block +``` + +another list """, ), pluginRuleTest( @@ -3690,76 +5845,64 @@ > + another list """, ), - pluginRuleTest( # see sub3 test_extra_044cx test_extra_044ca - "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_thematics", + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_double_drop", source_file_contents="""> + list 1 > + list 2 > list 3 -> ------ -> ```block -> A code block -> ``` -> ------ -> + another list +> ```block +> A code block +> ``` +> another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""> + list 1 > + list 2 > list 3 -> ------ > -> ```block -> A code block -> ``` +> ```block +> A code block +> ``` > -> ------ -> + another list +> another list """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_setext", + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_triple_drop", source_file_contents="""> + list 1 > + list 2 > list 3 -> -> abc -> ------ -> ```block -> A code block -> ``` -> abc -> ------ -> + another list +```block +A code block +``` +another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:9:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, - disable_rules="md032,md022,md024", + disable_rules="md032", fix_expected_file_contents="""> + list 1 > + list 2 > list 3 -> -> abc -> ------ -> -> ```block -> A code block -> ``` -> -> abc -> ------ -> + another list + +```block +A code block +``` + +another list """, ), - pluginRuleTest( - "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_thematics_sub1", + pluginRuleTest( # see sub3 test_extra_044cx test_extra_044ca + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_thematics", source_file_contents="""> + list 1 -> list 2 +> + list 2 +> list 3 > ------ > ```block > A code block @@ -3768,12 +5911,13 @@ > + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, - disable_rules="md022,md023", + disable_rules="md032", fix_expected_file_contents="""> + list 1 -> list 2 +> + list 2 +> list 3 > ------ > > ```block @@ -3785,15 +5929,139 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_thematics_sub2", + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_double_drop_with_thematics", source_file_contents="""> + list 1 -> list 2 +> + list 2 > list 3 -> _____ -> ```block -> A code block -> ``` -> _____ +> ------ +> ```block +> A code block +> ``` +> ------ +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> + list 1 +> + list 2 +> list 3 +> ------ +> +> ```block +> A code block +> ``` +> +> ------ +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_triple_drop_with_thematics", + source_file_contents="""> + list 1 +> + list 2 +> list 3 +------ +```block +A code block +``` +------ +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> + list 1 +> + list 2 +> list 3 +------ + +```block +A code block +``` + +------ +another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_setext", + source_file_contents="""> + list 1 +> + list 2 +> list 3 +> +> abc +> ------ +> ```block +> A code block +> ``` +> abc +> ------ +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:9:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md022,md024", + fix_expected_file_contents="""> + list 1 +> + list 2 +> list 3 +> +> abc +> ------ +> +> ```block +> A code block +> ``` +> +> abc +> ------ +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_thematics_sub1", + source_file_contents="""> + list 1 +> list 2 +> ------ +> ```block +> A code block +> ``` +> ------ +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md022,md023", + fix_expected_file_contents="""> + list 1 +> list 2 +> ------ +> +> ```block +> A code block +> ``` +> +> ------ +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_with_thematics_sub2", + source_file_contents="""> + list 1 +> list 2 +> list 3 +> _____ +> ```block +> A code block +> ``` +> _____ > + another list """, scan_expected_return_code=1, @@ -4007,6 +6275,96 @@ > > > > ----- > + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_blockx_double_drop", + source_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> ```block +> A code block +> ``` +> ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_blockx_triple_drop", + source_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027,md007,md023", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( # test_extra_049e0 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_blockx_quad_drop", + source_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + use_debug=True, + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > > block 1 +> > > block 2 + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( # test_extra_047d0, test_extra_047d1 @@ -4073,61 +6431,155 @@ > + another list """, ), - pluginRuleTest( # test_extra_044mcv0 test_extra_044mcv1 - "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_with_thematics_fixed", + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_double_drop_with_thematics", source_file_contents="""> + > ----- > > > block 1 > > > block 2 -> > ----- -> > -> > ```block -> > A code block -> > ``` -> > -> > ----- +> ----- +> ```block +> A code block +> ``` +> ----- > + another list """, - scan_expected_return_code=0, - scan_expected_output="", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_with_setext", + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_triple_drop_with_thematics", source_file_contents="""> + > ----- > > > block 1 > > > block 2 -> > -> > abc -> > ----- -> > ```block -> > A code block -> > ``` -> > abc -> > ----- -> + another list +> ----- +> ```block +> A code block +> ``` +> ----- +> another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:9:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, - disable_rules="md032,md027,md022", + disable_rules="md032,md027", + mark_fix_as_skipped=True, fix_expected_file_contents="""> + > ----- > > > block 1 > > > block 2 -> > -> > abc -> > ----- -> > -> > ```block -> > A code block -> > ``` -> > -> > abc -> > ----- -> + another list -""", - ), - pluginRuleTest( +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( # test_extra_049h0 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_quad_drop_with_thematics", + source_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +----- + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( # test_extra_044mcv0 test_extra_044mcv1 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_with_thematics_fixed", + source_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> > ----- +> > +> > ```block +> > A code block +> > ``` +> > +> > ----- +> + another list +""", + scan_expected_return_code=0, + scan_expected_output="", + disable_rules="md032,md027", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_with_setext", + source_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> > +> > abc +> > ----- +> > ```block +> > A code block +> > ``` +> > abc +> > ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:9:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027,md022", + fix_expected_file_contents="""> + > ----- +> > > block 1 +> > > block 2 +> > +> > abc +> > ----- +> > +> > ```block +> > A code block +> > ``` +> > +> > abc +> > ----- +> + another list +""", + ), + pluginRuleTest( "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list", source_file_contents="""> + > ----- > > + list 1 @@ -4155,6 +6607,100 @@ > > > > ----- > + another list +""", + ), + pluginRuleTest( # test_extra_049l7 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_double_drop", + source_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ```block +> A code block +> ``` +> ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_scan_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", + ), + pluginRuleTest( # test_extra_049l8 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_triple_drop", + source_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( # test_extra_049j0 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_quad_drop", + source_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( # test_extra_044mcu0 test_extra_044mcu1 @@ -4187,6 +6733,106 @@ > > > > ----- > + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_double_drop_and_thematics", + source_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ----- +> ```block +> A code block +> ``` +> ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_triple_drop_and_thematics", + source_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ----- +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( # test_extra_049j1 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_quad_drop_and_thematics", + source_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +----- + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( @@ -4301,21 +6947,109 @@ > + another list """, ), - pluginRuleTest( # test_extra_044mct0 test_extra_044mct1 - "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_with_thematics", + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_double_drop", source_file_contents="""> + + ----- > > block 1 > > block 2 -> ----- -> ```block -> A code block -> ``` -> ----- +> ```block +> A code block +> ``` +> ----- > + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + + ----- +> > block 1 +> > block 2 +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_triple_drop", + source_file_contents="""> + + ----- +> > block 1 +> > block 2 +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + + ----- +> > block 1 +> > block 2 +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( # test_extra_049d0 + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_quad_drop", + source_file_contents="""> + + ----- +> > block 1 +> > block 2 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> + + ----- +> > block 1 +> > block 2 + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( # test_extra_044mct0 test_extra_044mct1 + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_with_thematics", + source_file_contents="""> + + ----- +> > block 1 +> > block 2 +> ----- +> ```block +> A code block +> ``` +> ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032,md027", fix_expected_file_contents="""> + + ----- @@ -4329,6 +7063,100 @@ > > ----- > + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_double_drop_with_thematics", + source_file_contents="""> + + ----- +> > block 1 +> > block 2 +> ----- +> ```block +> A code block +> ``` +> ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + + ----- +> > block 1 +> > block 2 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_triple_drop_with_thematics", + source_file_contents="""> + + ----- +> > block 1 +> > block 2 +> ----- +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + + ----- +> > block 1 +> > block 2 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( # test_extra_049d1 + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_quad_drop_with_thematics", + source_file_contents="""> + + ----- +> > block 1 +> > block 2 +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + mark_fix_as_skipped=True, + use_debug=True, + fix_expected_file_contents="""> + + ----- +> > block 1 +> > block 2 +----- + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( @@ -4397,88 +7225,277 @@ > + another list """, ), - pluginRuleTest( # test_extra_044mcs0 test_extra_044mcs1 - "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_and_thematics", + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_double_drop", source_file_contents="""> + + ----- > + list 1 > list 2 > + list 3 -> ----- -> ```block -> A code block -> ``` -> ----- +> ```block +> A code block +> ``` +> ----- > + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""> + + ----- > + list 1 > list 2 > + list 3 -> ----- > -> ```block -> A code block -> ``` +> ```block +> A code block +> ``` > -> ----- +> ----- > + another list """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_and_setext", + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_triple_drop", source_file_contents="""> + + ----- > + list 1 > list 2 > + list 3 +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 > -> abc +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_quad_drop", + source_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( # test_extra_044mcs0 test_extra_044mcs1 + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_and_thematics", + source_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 > ----- > ```block > A code block > ``` -> abc > ----- > + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:10:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, - disable_rules="md032,md022,md024", + disable_rules="md032", fix_expected_file_contents="""> + + ----- > + list 1 > list 2 > + list 3 -> -> abc > ----- > > ```block > A code block > ``` > -> abc > ----- > + another list """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_list", - source_file_contents="""+ + ----- - ```block - A code block - ``` - ----- - + another list + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_double_drop_and_thematics", + source_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +> ----- +> ```block +> A code block +> ``` +> ----- +> + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:2:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_triple_drop_and_thematics", + source_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +> ----- +> ```block +> A code block +> ``` +> ----- +> another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +> ----- +> +> ```block +> A code block +> ``` +> +> ----- +> another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_quad_drop_and_thematics", + source_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +----- + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_and_setext", + source_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +> +> abc +> ----- +> ```block +> A code block +> ``` +> abc +> ----- +> + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:10:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md022,md024", + fix_expected_file_contents="""> + + ----- +> + list 1 +> list 2 +> + list 3 +> +> abc +> ----- +> +> ```block +> A code block +> ``` +> +> abc +> ----- +> + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list", + source_file_contents="""+ + ----- + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:2:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", fix_expected_file_contents="""+ + ----- @@ -4559,6 +7576,59 @@ ``` + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_block_double_drop", + source_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 + ```block + A code block + ``` + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 + + ```block + A code block + ``` + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_block_triple_drop", + source_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 +```block +A code block +``` +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 + +```block +A code block +``` + +another list """, ), pluginRuleTest( @@ -4587,6 +7657,68 @@ ``` + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_block_double_drop_with_thematics", + source_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 + ---- + ```block + A code block + ``` + ---- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 + ---- + + ```block + A code block + ``` + + ---- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_block_triple_drop_with_thematics", + source_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 +---- +```block +A code block +``` +---- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + list 1 + > block 2.1 + > block 2.2 +---- + +```block +A code block +``` + +---- +another list """, ), pluginRuleTest( @@ -4649,6 +7781,59 @@ ``` + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_list_double_drop", + source_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 + ```block + A code block + ``` + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 + + ```block + A code block + ``` + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_list_triple_drop", + source_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 +```block +A code block +``` +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 + +```block +A code block +``` + +another list """, ), pluginRuleTest( # test_extra_047g0 test_extra_047g1 @@ -4679,7 +7864,65 @@ + another list """, ), - pluginRuleTest( # test_extra_047g2 test_extra_047g3 + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_list_double_drop_with_thematics", + source_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 + ---- + ```block + A code block + ``` + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 + ---- + + ```block + A code block + ``` + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_with_previous_inner_list_triple_drop_with_thematics", + source_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 +---- +```block +A code block +``` +---- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + list 1 ++ + + list 2.1 + list 2.2 +---- + +```block +A code block +``` + +---- +another list +""", + ), + pluginRuleTest( # test_extra_047g2 test_extra_047g3 "bad_fenced_block_in_list_in_list2_with_previous_inner_list_with_thematics", source_file_contents="""+ + list 1 + list 2.1 @@ -4891,27 +8134,392 @@ + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:4:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:4:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + > + > ```block + > A code block + > ``` + > + > ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_double_drop", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + + ```block + A code block + ``` + + ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_triple_drop", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 + ```block + A code block + ``` + ----- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + + ```block + A code block + ``` + + ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_quad_drop", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( # test_extra_044lc + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_and_thematics", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 + > ----- + > ```block + > A code block + > ``` + > ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + > ----- + > + > ```block + > A code block + > ``` + > + > ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_double_drop_and_thematics", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 + ----- + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + ----- + + ```block + A code block + ``` + + ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_triple_drop_and_thematics", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 + ----- + ```block + A code block + ``` + ----- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + ----- + + ```block + A code block + ``` + + ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_quad_drop_and_thematics", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 +----- + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_and_setext", + source_file_contents="""+ + > ----- + > > block 1 + > > block 2 + > + > abc + > ----- + > ```block + > A code block + > ``` + > abc + > ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:9:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md022,md024", + fix_expected_file_contents="""+ + > ----- + > > block 1 + > > block 2 + > + > abc + > ----- + > + > ```block + > A code block + > ``` + > + > abc + > ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list", + source_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 + > ```block + > A code block + > ``` + > ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 + > + > ```block + > A code block + > ``` + > + > ----- + + another list +""", + ), + pluginRuleTest( # test_extra_049l9 + "bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_triple_drop", + source_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 + + ```block + A code block + ``` + + ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_triple_drop", + source_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 + ```block + A code block + ``` + ----- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 + + ```block + A code block + ``` + + ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_quad_drop", + source_file_contents="""+ + > ----- + > + list 1 + > list 2 + > + list 3 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", fix_expected_file_contents="""+ + > ----- - > > block 1 - > > block 2 - > - > ```block - > A code block - > ``` - > - > ----- - + another list + > + list 1 + > list 2 + > + list 3 + +```block +A code block +``` + +----- +another list """, ), - pluginRuleTest( # test_extra_044lc - "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_and_thematics", + pluginRuleTest( + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_and_thematics", source_file_contents="""+ + > ----- - > > block 1 - > > block 2 + > + list 1 + > list 2 + > + list 3 > ----- > ```block > A code block @@ -4920,13 +8528,14 @@ + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", fix_expected_file_contents="""+ + > ----- - > > block 1 - > > block 2 + > + list 1 + > list 2 + > + list 3 > ----- > > ```block @@ -4938,101 +8547,101 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_and_setext", + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_double_drop_and_thematics", source_file_contents="""+ + > ----- - > > block 1 - > > block 2 - > - > abc - > ----- - > ```block - > A code block - > ``` - > abc - > ----- + > + list 1 + > list 2 + > + list 3 + ----- + ```block + A code block + ``` + ----- + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:9:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, - disable_rules="md032,md022,md024", + disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""+ + > ----- - > > block 1 - > > block 2 - > - > abc - > ----- - > - > ```block - > A code block - > ``` - > - > abc - > ----- + > + list 1 + > list 2 + > + list 3 + ----- + + ```block + A code block + ``` + + ----- + another list """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list", + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_triple_drop_and_thematics", source_file_contents="""+ + > ----- > + list 1 > list 2 > + list 3 - > ```block - > A code block - > ``` - > ----- - + another list + ----- + ```block + A code block + ``` + ----- + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""+ + > ----- > + list 1 > list 2 > + list 3 - > - > ```block - > A code block - > ``` - > - > ----- - + another list + ----- + + ```block + A code block + ``` + + ----- + another list """, ), pluginRuleTest( - "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_and_thematics", + "bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_quad_drop_and_thematics", source_file_contents="""+ + > ----- > + list 1 > list 2 > + list 3 - > ----- - > ```block - > A code block - > ``` - > ----- - + another list +----- +```block +A code block +``` +----- +another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:8:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:8:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", fix_expected_file_contents="""+ + > ----- > + list 1 > list 2 > + list 3 - > ----- - > - > ```block - > A code block - > ``` - > - > ----- - + another list +----- + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( @@ -5074,8 +8683,150 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_list_in_list", + "bad_fenced_block_in_list_in_list_in_list", + source_file_contents="""+ + + ----- + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:2:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:4:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + ----- + + ```block + A code block + ``` + + ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_block", + source_file_contents="""+ + + ----- + > block 1 + > block 2 + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + ----- + > block 1 + > block 2 + + ```block + A code block + ``` + + ----- + + another list +""", + ), + pluginRuleTest( # test_extra_049l4x + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_double_drop", + source_file_contents="""+ + + ----- + > block 1 + > block 2 + ```block + A code block + ``` + ----- + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032,md027", + use_debug=True, + mark_scan_as_skipped=True, + fix_expected_file_contents="""+ + + ----- + > block 1 + > block 2 + + ```block + A code block + ``` + + ----- + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_triple_drop", + source_file_contents="""+ + + ----- + > block 1 + > block 2 + ```block + A code block + ``` + ----- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + + ----- + > block 1 + > block 2 + + ```block + A code block + ``` + + ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_quad_drop", + source_file_contents="""+ + + ----- + > block 1 + > block 2 +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:4:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:6:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + ----- + > block 1 + > block 2 + +```block +A code block +``` + +----- +another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_with_thematics", source_file_contents="""+ + + ----- + > block 1 + > block 2 + ----- ```block A code block ``` @@ -5083,11 +8834,14 @@ + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:2:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:4:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", fix_expected_file_contents="""+ + + ----- + > block 1 + > block 2 + ----- ```block A code block @@ -5098,61 +8852,95 @@ """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_list_in_list_with_previous_block", + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_double_drop_with_thematics", source_file_contents="""+ + + ----- > block 1 > block 2 - ```block - A code block - ``` - ----- + ----- + ```block + A code block + ``` + ----- + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:4:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:6:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""+ + + ----- > block 1 > block 2 + ----- - ```block - A code block - ``` + ```block + A code block + ``` - ----- + ----- + another list """, ), pluginRuleTest( - "bad_fenced_block_in_list_in_list_in_list_with_previous_block_with_thematics", + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_triple_drop_with_thematics", source_file_contents="""+ + + ----- > block 1 > block 2 - ----- - ```block - A code block - ``` - ----- - + another list + ----- + ```block + A code block + ``` + ----- + another list """, scan_expected_return_code=1, - scan_expected_output="""{temp_source_path}:5:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) -{temp_source_path}:7:7: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) """, disable_rules="md032", + mark_fix_as_skipped=True, fix_expected_file_contents="""+ + + ----- > block 1 > block 2 - ----- + ----- - ```block - A code block - ``` + ```block + A code block + ``` - ----- - + another list + ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_block_quad_drop_with_thematics", + source_file_contents="""+ + + ----- + > block 1 + > block 2 +----- +```block +A code block +``` +----- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + ----- + > block 1 + > block 2 +----- + +```block +A code block +``` + +----- +another list """, ), pluginRuleTest( @@ -5200,6 +8988,7 @@ ```block A code block ``` + ---- + another list """, scan_expected_return_code=1, @@ -5216,7 +9005,98 @@ A code block ``` + ---- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_inner_list_double_drop_with_thematics", + source_file_contents="""+ + + list 1 ++ + + + list 2.1 + list 2.2 + ---- + ```block + A code block + ``` + ---- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + list 1 ++ + + + list 2.1 + list 2.2 + ---- + + ```block + A code block + ``` + + ---- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_inner_list_triple_drop_with_thematics", + source_file_contents="""+ + + list 1 ++ + + + list 2.1 + list 2.2 + ---- + ```block + A code block + ``` + ---- + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + list 1 ++ + + + list 2.1 + list 2.2 + ---- + + ```block + A code block + ``` + + ---- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_inner_list_quad_drop_with_thematics", + source_file_contents="""+ + + list 1 ++ + + + list 2.1 + list 2.2 +---- +```block +A code block +``` +---- +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + list 1 ++ + + + list 2.1 + list 2.2 +---- + +```block +A code block +``` + +---- +another list """, ), pluginRuleTest( # test_extra_044mcq0 test_extra_044mcq1 @@ -5249,6 +9129,92 @@ ----- + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_list_double_drop", + source_file_contents="""+ + + ----- + + list 1 + list 2 + + list 3 + ```block + A code block + ``` + + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:5: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + + ----- + + list 1 + list 2 + + list 3 + + ```block + A code block + ``` + + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_list_triple_drop", + source_file_contents="""+ + + ----- + + list 1 + list 2 + + list 3 + ```block + A code block + ``` + another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:3: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + mark_fix_as_skipped=True, + fix_expected_file_contents="""+ + + ----- + + list 1 + list 2 + + list 3 + + ```block + A code block + ``` + + another list +""", + ), + pluginRuleTest( + "bad_fenced_block_in_list_in_list_in_list_with_previous_list_quad_drop", + source_file_contents="""+ + + ----- + + list 1 + list 2 + + list 3 +```block +A code block +``` +another list +""", + scan_expected_return_code=1, + scan_expected_output="""{temp_source_path}:5:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +{temp_source_path}:7:1: MD031: Fenced code blocks should be surrounded by blank lines (blanks-around-fences) +""", + disable_rules="md032", + fix_expected_file_contents="""+ + + ----- + + list 1 + list 2 + + list 3 + +```block +A code block +``` + +another list """, ), pluginRuleTest( diff --git a/test/rules/utils.py b/test/rules/utils.py index 7885cf887..860db5d11 100644 --- a/test/rules/utils.py +++ b/test/rules/utils.py @@ -169,7 +169,11 @@ def calculate_scan_tests(scanTests: List[pluginRuleTest]) -> List[pluginRuleTest def calculate_fix_tests(scanTests: List[pluginRuleTest]) -> List[pluginRuleTest]: return [ - (pytest.param(i, marks=pytest.mark.skip) if i.mark_fix_as_skipped else i) + ( + pytest.param(i, marks=pytest.mark.skip) + if i.mark_fix_as_skipped or i.mark_scan_as_skipped + else i + ) for i in scanTests if i.fix_expected_file_contents is not None ] diff --git a/test/test_markdown_extra.py b/test/test_markdown_extra.py index 8b42ca869..eec32ac3c 100644 --- a/test/test_markdown_extra.py +++ b/test/test_markdown_extra.py @@ -6256,7 +6256,7 @@ def test_extra_044mb(): """ # Act & Assert - act_and_assert(source_markdown, expected_gfm, expected_tokens) + act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=False) @pytest.mark.gfm @@ -6437,7 +6437,7 @@ def test_extra_044mcc(): """ # Act & Assert - act_and_assert(source_markdown, expected_gfm, expected_tokens) + act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=False) @pytest.mark.gfm @@ -6518,6 +6518,7 @@ def test_extra_044mce(): def test_extra_046a(): """ TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block """ # Arrange @@ -7442,22 +7443,1690 @@ def test_extra_047f5(): @pytest.mark.gfm -def test_extra_999(): +def test_extra_049a0(): """ - Temporary test to keep coverage up while consistency checks disabled. + TBD + bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_double_drop_with_thematics """ - new_position = PositionMarker(1, 0, "text") + # Arrange + source_markdown = """1. > + ---- + > + list 1 + > list 2 + > + list 3 + > ---- + > ```block + > A code block + > ``` + > ---- +""" + expected_tokens = [ + "[olist(1,1):.:1:3::\n\n\n\n]", + "[block-quote(1,4): : > \n > \n > \n > \n > \n > \n > \n > \n > \n]", + "[ulist(1,6):+::7:]", + "[tbreak(1,8):-::----]", + "[ulist(2,8):+::9: : \n]", + "[para(2,10):\n]", + "[text(2,10):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,8):9: :]", + "[para(4,10):]", + "[text(4,10):list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-ulist:::True]", + "[tbreak(5,6):-::----]", + "[fcode-block(6,6):`:3:block:::::]", + "[text(7,6):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(9,6):-::----]", + "[end-block-quote:::True]", + "[BLANK(10,1):]", + "[end-olist:::True]", + ] + expected_gfm = """
    +
  1. +
    +
      +
    • +
      +
        +
      • list 1 +list 2
      • +
      • list 3
      • +
      +
    • +
    +
    +
    A code block
    +
    +
    +
    +
  2. +
""" - new_block_quote = BlockQuoteMarkdownToken("", new_position) - ex_ws = new_block_quote.extracted_whitespace - assert not ex_ws + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) - new_front_matter = FrontMatterMarkdownToken("--", "--", ["a: b"], {}, new_position) - new_value = new_front_matter.calculate_block_token_height(new_front_matter) - assert new_value != 999 - new_value = new_front_matter.calculate_initial_whitespace() - assert new_value != 999 - assert new_front_matter.is_extension - ParserHelper.count_newlines_in_texts("text") +@pytest.mark.gfm +def test_extra_049b0(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_triple_drop + """ + + # Arrange + source_markdown = """> > + -------- +> > > block 1 +> > > block 2 +> -------- +> ```block +> A code block +> ``` +> -------- +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n> \n]", + "[block-quote(1,3)::> > \n> > ]", + "[ulist(1,5):+::6::\n\n]", + "[tbreak(1,7):-::--------]", + "[block-quote(2,7)::> \n> > > \n> ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::False]", + "[end-block-quote::> :True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[tbreak(4,3):-::--------]", + "[fcode-block(5,3):`:3:block:::::]", + "[text(6,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,3):-::--------]", + "[end-block-quote:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+
+ +
+
+
A code block
+
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=False) + + +@pytest.mark.gfm +def test_extra_049b1(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_triple_drop_with_thematics + """ + + # Arrange + source_markdown = """> > + -------- +> > > block 1 +> > > block 2 +> -------- +> ```block +> A code block +> ``` +> -------- +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n> \n]", + "[block-quote(1,3)::> > \n> > ]", + "[ulist(1,5):+::6::\n\n]", + "[tbreak(1,7):-::--------]", + "[block-quote(2,7)::> \n> > > \n> ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::False]", + "[end-block-quote::> :True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[tbreak(4,3):-::--------]", + "[fcode-block(5,3):`:3:block:::::]", + "[text(6,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,3):-::--------]", + "[end-block-quote:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+
+ +
+
+
A code block
+
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049c0(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_quad_drop + """ + + # Arrange + source_markdown = """> > + -------- +> > > block 1 +> > > block 2 +```block +A code block +``` +-------- +""" + expected_tokens = [ + "[block-quote(1,1)::]", + "[block-quote(1,3)::> > \n> > ]", + "[ulist(1,5):+::6::\n\n]", + "[tbreak(1,7):-::--------]", + "[block-quote(2,7)::> \n> > > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-block-quote:::True]", + "[fcode-block(4,1):`:3:block:::::]", + "[text(5,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,1):-::--------]", + "[BLANK(8,1):]", + ] + expected_gfm = """
+
+ +
+
+
A code block
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049c1(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_quad_drop_with_thematics + """ + + # Arrange + source_markdown = """> > + -------- +> > > block 1 +> > > block 2 +-------- +```block +A code block +``` +-------- +""" + expected_tokens = [ + "[block-quote(1,1)::]", + "[block-quote(1,3)::> > \n> > ]", + "[ulist(1,5):+::6::\n\n]", + "[tbreak(1,7):-::--------]", + "[block-quote(2,7)::> \n> > > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-block-quote:::True]", + "[tbreak(4,1):-::--------]", + "[fcode-block(5,1):`:3:block:::::]", + "[text(6,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,1):-::--------]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+
+ +
+
+
+
A code block
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049d0(): + """ + TBD + bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_quad_drop + """ + + # Arrange + source_markdown = """> + + ----- +> > block 1 +> > block 2 +```block +A code block +``` +----- +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> ]", + "[ulist(1,3):+::4:]", + "[ulist(1,5):+::6: :\n\n]", + "[tbreak(1,7):-::-----]", + "[block-quote(2,7)::> > \n> > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(4,1):`:3:block:::::]", + "[text(5,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,1):-::-----]", + "[para(8,1):]", + "[text(8,1):another list:]", + "[end-para:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+ +
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049d1(): + """ + TBD + bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_quad_drop_with_thematics + """ + + # Arrange + source_markdown = """> + + ----- +> > block 1 +> > block 2 +----- +```block +A code block +``` +----- +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> ]", + "[ulist(1,3):+::4:]", + "[ulist(1,5):+::6: :\n\n]", + "[tbreak(1,7):-::-----]", + "[block-quote(2,7)::> > \n> > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[tbreak(4,1):-::-----]", + "[fcode-block(5,1):`:3:block:::::]", + "[text(6,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,1):-::-----]", + "[para(9,1):]", + "[text(9,1):another list:]", + "[end-para:::True]", + "[BLANK(10,1):]", + ] + expected_gfm = """
+ +
+
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049e0(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_blockx_quad_drop + """ + + # Arrange + source_markdown = """> + > ----- +> > > block 1 +> > > block 2 +```block +A code block +``` +----- +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> ]", + "[ulist(1,3):+::4::\n\n]", + "[block-quote(1,5)::> \n> > ]", + "[tbreak(1,7):-::-----]", + "[block-quote(2,7)::> > > \n> > > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(4,1):`:3:block:::::]", + "[text(5,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,1):-::-----]", + "[para(8,1):]", + "[text(8,1):another list:]", + "[end-para:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+ +
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049f0(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_quad_drop + """ + + # Arrange + source_markdown = """1. > + ---- + > > block 1 + > > block 2 +```block +A code block +``` +---- +""" + expected_tokens = [ + "[olist(1,1):.:1:3:]", + "[block-quote(1,4): : > \n > ]", + "[ulist(1,6):+::7::\n\n]", + "[tbreak(1,8):-::----]", + "[block-quote(2,8)::> \n > > ]", + "[para(2,10):\n]", + "[text(2,10):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-olist:::True]", + "[fcode-block(4,1):`:3:block:::::]", + "[text(5,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,1):-::----]", + "[BLANK(8,1):]", + ] + expected_gfm = """
    +
  1. +
    +
      +
    • +
      +
      +

      block 1 +block 2

      +
      +
    • +
    +
    +
  2. +
+
A code block
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049g0(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_triple_drop + """ + + # Arrange + source_markdown = """1. > + ---- + > > block 1 + > > block 2 +```block +A code block +``` +---- +""" + expected_tokens = [ + "[olist(1,1):.:1:3:]", + "[block-quote(1,4): : > \n > ]", + "[ulist(1,6):+::7::\n\n]", + "[tbreak(1,8):-::----]", + "[block-quote(2,8)::> \n > > ]", + "[para(2,10):\n]", + "[text(2,10):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-olist:::True]", + "[fcode-block(4,1):`:3:block:::::]", + "[text(5,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,1):-::----]", + "[BLANK(8,1):]", + ] + expected_gfm = """
    +
  1. +
    +
      +
    • +
      +
      +

      block 1 +block 2

      +
      +
    • +
    +
    +
  2. +
+
A code block
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049h0(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_quad_drop_with_thematics + """ + + # Arrange + source_markdown = """> + > ----- +> > > block 1 +> > > block 2 +----- +```block +A code block +``` +----- +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> ]", + "[ulist(1,3):+::4::\n\n]", + "[block-quote(1,5)::> \n> > ]", + "[tbreak(1,7):-::-----]", + "[block-quote(2,7)::> > > \n> > > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[tbreak(4,1):-::-----]", + "[fcode-block(5,1):`:3:block:::::]", + "[text(6,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,1):-::-----]", + "[para(9,1):]", + "[text(9,1):another list:]", + "[end-para:::True]", + "[BLANK(10,1):]", + ] + expected_gfm = """
+ +
+
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049j0(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_quad_drop + """ + + # Arrange + source_markdown = """> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +```block +A code block +``` +----- +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> ]", + "[ulist(1,3):+::4::]", + "[block-quote(1,5)::> \n> > \n> > \n> > ]", + "[tbreak(1,7):-::-----]", + "[ulist(2,7):+::8:: ]", + "[para(2,9):\n]", + "[text(2,9):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):list 3:]", + "[end-para:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,1):`:3:block:::::]", + "[text(6,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,1):-::-----]", + "[para(9,1):]", + "[text(9,1):another list:]", + "[end-para:::True]", + "[BLANK(10,1):]", + ] + expected_gfm = """
+ +
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049j1(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_quad_drop_and_thematics + """ + + # Arrange + source_markdown = """> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +----- +```block +A code block +``` +----- +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> ]", + "[ulist(1,3):+::4::]", + "[block-quote(1,5)::> \n> > \n> > \n> > ]", + "[tbreak(1,7):-::-----]", + "[ulist(2,7):+::8:: ]", + "[para(2,9):\n]", + "[text(2,9):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):list 3:]", + "[end-para:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[tbreak(5,1):-::-----]", + "[fcode-block(6,1):`:3:block:::::]", + "[text(7,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(9,1):-::-----]", + "[para(10,1):]", + "[text(10,1):another list:]", + "[end-para:::True]", + "[BLANK(11,1):]", + ] + expected_gfm = """
+ +
+
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049k0(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_triple_drop + """ + + # Arrange + source_markdown = """> + list 1 +> > block 2 +> > block 3 +------ +```block +A code block +``` +------ +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> ]", + "[ulist(1,3):+::4::\n\n]", + "[para(1,5):]", + "[text(1,5):list 1:]", + "[end-para:::True]", + "[block-quote(2,5)::> \n> > ]", + "[para(2,7):\n]", + "[text(2,7):block 2\nblock 3::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[tbreak(4,1):-::------]", + "[fcode-block(5,1):`:3:block:::::]", + "[text(6,1):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,1):-::------]", + "[para(9,1):]", + "[text(9,1):another list:]", + "[end-para:::True]", + "[BLANK(10,1):]", + ] + expected_gfm = """
+ +
+
+
A code block
+
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049k1(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_triple_drop_without_thematics + """ + + # Arrange + source_markdown = """> + list 1 +> > block 2 +> > block 3 +```block +A code block +``` +another list +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> ]", + "[ulist(1,3):+::4::\n\n]", + "[para(1,5):]", + "[text(1,5):list 1:]", + "[end-para:::True]", + "[block-quote(2,5)::> \n> > ]", + "[para(2,7):\n]", + "[text(2,7):block 2\nblock 3::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(4,1):`:3:block:::::]", + "[text(5,1):A code block:]", + "[end-fcode-block:::3:False]", + "[para(7,1):]", + "[text(7,1):another list:]", + "[end-para:::True]", + "[BLANK(8,1):]", + ] + expected_gfm = """
+ +
+
A code block
+
+

another list

""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l0(): + """ + TBD + bad_fenced_block_in_block_quote_in_block_quote_with_previous_inner_list_double_drop + """ + + # Arrange + source_markdown = """> > + block 3 +> > block 3 +> > + block 3 +> ```block +> A code block +> ``` +> -------- +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n]", + "[block-quote(1,3)::> > \n> > \n> > \n> ]", + "[ulist(1,5):+::6:: \n]", + "[para(1,7):\n]", + "[text(1,7):block 3\nblock 3::\n]", + "[end-para:::True]", + "[li(3,5):6::]", + "[para(3,7):]", + "[text(3,7):block 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(4,3):`:3:block:::::]", + "[text(5,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,3):-::--------]", + "[end-block-quote:::True]", + "[BLANK(8,1):]", + ] + expected_gfm = """
+
+ +
+
A code block
+
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=False) + + +@pytest.mark.gfm +def test_extra_049l1(): + """ + TBD + bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_double_drop + """ + + # Arrange + source_markdown = """> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +> > ```block +> > A code block +> > ``` +> > -------- +""" + expected_tokens = [ + "[block-quote(1,1)::]", + "[block-quote(1,3)::> > \n> > \n> > \n]", + "[block-quote(1,5)::> > >\n> > > \n> > > \n> > > \n> > ]", + "[BLANK(1,6):]", + "[ulist(2,7):+::8:: \n]", + "[para(2,9):\n]", + "[text(2,9):inner list 1\ninner list 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):inner list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,5):`:3:block:::::]", + "[text(6,5):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,5):-::--------]", + "[end-block-quote:::True]", + "[end-block-quote:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+
+
+
    +
  • inner list 1 +inner list 2
  • +
  • inner list 3
  • +
+
+
A code block
+
+
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l2(): + """ + TBD + bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_list_triple_drop + """ + + # Arrange + source_markdown = """> > > +> > > + inner list 1 +> > > inner list 2 +> > > + inner list 3 +> ```block +> A code block +> ``` +> -------- +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n]", + "[block-quote(1,3)::]", + "[block-quote(1,5)::> > >\n> > > \n> > > \n> > > \n> ]", + "[BLANK(1,6):]", + "[ulist(2,7):+::8:: \n]", + "[para(2,9):\n]", + "[text(2,9):inner list 1\ninner list 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):inner list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,3):`:3:block:::::]", + "[text(6,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,3):-::--------]", + "[end-block-quote:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+
+
+
    +
  • inner list 1 +inner list 2
  • +
  • inner list 3
  • +
+
+
+
A code block
+
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l3(): + """ + TBD + bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_triple_drop + """ + + # Arrange + source_markdown = """> > + ______ +> > + list 1 +> > list 2 +> > + list 3 +> ```block +> A code block +> ``` +> ______ +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n]", + "[block-quote(1,3)::> > \n> > \n> > \n> > \n> ]", + "[ulist(1,5):+::6:]", + "[tbreak(1,7):_::______]", + "[ulist(2,7):+::8: : \n]", + "[para(2,9):\n]", + "[text(2,9):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,7):8: :]", + "[para(4,9):]", + "[text(4,9):list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,3):`:3:block:::::]", + "[text(6,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,3):_::______]", + "[end-block-quote:::True]", + "[BLANK(9,1):]", + ] + expected_gfm = """
+
+ +
+
A code block
+
+
+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l5(): + """ + TBD + bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list_double_drop + """ + + # Arrange + source_markdown = """1. > > ---- + > > + block 1 + > > block 2 + > ```block + > A code block + > ``` + > ---- +""" + expected_tokens = [ + "[olist(1,1):.:1:3::\n\n\n]", + "[block-quote(1,4): : > \n > \n > \n]", + "[block-quote(1,6): : > > \n > > \n > > \n > ]", + "[tbreak(1,8):-::----]", + "[ulist(2,8):+::9:: \n]", + "[para(2,10):\n]", + "[text(2,10):block 1\nblock 2::\n]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(4,6):`:3:block:::::]", + "[text(5,6):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,6):-::----]", + "[end-block-quote:::True]", + "[BLANK(8,1):]", + "[end-olist:::True]", + ] + expected_gfm = """
    +
  1. +
    +
    +
    +
      +
    • block 1 +block 2
    • +
    +
    +
    A code block
    +
    +
    +
    +
  2. +
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l6(): + """ + TBD + bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_double_drop + """ + + # Arrange + source_markdown = """1. > > ---- + > > + list 1 + > > list 2 + > > + list 3 + > ```block + > A code block + > ``` + > ---- +""" + expected_tokens = [ + "[olist(1,1):.:1:3::\n\n\n]", + "[block-quote(1,4): : > \n > \n > \n]", + "[block-quote(1,6): : > > \n > > \n > > \n > > \n > ]", + "[tbreak(1,8):-::----]", + "[ulist(2,8):+::9:: \n]", + "[para(2,10):\n]", + "[text(2,10):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,8):9::]", + "[para(4,10):]", + "[text(4,10):list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,6):`:3:block:::::]", + "[text(6,6):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,6):-::----]", + "[end-block-quote:::True]", + "[BLANK(9,1):]", + "[end-olist:::True]", + ] + expected_gfm = """
    +
  1. +
    +
    +
    +
      +
    • list 1 +list 2
    • +
    • list 3
    • +
    +
    +
    A code block
    +
    +
    +
    +
  2. +
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l7(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_double_drop + """ + + # Arrange + source_markdown = """> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ```block +> A code block +> ``` +> ----- +> + another list +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n> \n> ]", + "[ulist(1,3):+::4:: \n \n \n]", + "[block-quote(1,5)::> \n> > \n> > \n> > \n> ]", + "[tbreak(1,7):-::-----]", + "[ulist(2,7):+::8:: \n ]", + "[para(2,9):\n]", + "[text(2,9):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,3):`:3:block:::::]", + "[text(6,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,5):-::-----]", + "[li(9,3):4::]", + "[para(9,5):]", + "[text(9,5):another list:]", + "[end-para:::True]", + "[BLANK(10,1):]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + ] + expected_gfm = """
+ +
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l8(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_triple_drop + """ + + # Arrange + source_markdown = """> + > ----- +> > + list 1 +> > list 2 +> > + list 3 +> ```block +> A code block +> ``` +> ----- +> another list +""" + expected_tokens = [ + "[block-quote(1,1)::> \n> \n> \n> \n> \n]", + "[ulist(1,3):+::4:]", + "[block-quote(1,5)::> \n> > \n> > \n> > \n> ]", + "[tbreak(1,7):-::-----]", + "[ulist(2,7):+::8:: \n]", + "[para(2,9):\n]", + "[text(2,9):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):list 3:]", + "[end-para:::False]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[fcode-block(5,3):`:3:block:::::]", + "[text(6,3):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,3):-::-----]", + "[para(9,3):]", + "[text(9,3):another list:]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[BLANK(10,1):]", + ] + expected_gfm = """
+ +
A code block
+
+
+

another list

+
""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +def test_extra_049l9(): + """ + TBD + bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_triple_drop + """ + + # Arrange + source_markdown = """+ + > ----- + > + list 1 + > list 2 + > + list 3 + ```block + A code block + ``` + ----- + + another list +""" + expected_tokens = [ + "[ulist(1,1):+::2:]", + "[ulist(1,3):+::4: : \n \n \n \n]", + "[block-quote(1,5): : > \n > \n > \n > ]", + "[tbreak(1,7):-::-----]", + "[ulist(2,7):+::8:: ]", + "[para(2,9):\n]", + "[text(2,9):list 1\nlist 2::\n]", + "[end-para:::True]", + "[li(4,7):8::]", + "[para(4,9):]", + "[text(4,9):list 3:]", + "[end-para:::True]", + "[end-ulist:::True]", + "[end-block-quote:::True]", + "[fcode-block(5,5):`:3:block:::::]", + "[text(6,5):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(8,5):-::-----]", + "[li(9,3):4: :]", + "[para(9,5):]", + "[text(9,5):another list:]", + "[end-para:::True]", + "[BLANK(10,1):]", + "[end-ulist:::True]", + "[end-ulist:::True]", + ] + expected_gfm = """""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens) + + +@pytest.mark.gfm +@pytest.mark.skip +def test_extra_049l4x(): + """ + TBD + bad_fenced_block_in_list_in_list_in_list_with_previous_block_double_drop + """ + + # Arrange + source_markdown = """+ + + ----- + > block 1 + > block 2 + ```block + A code block + ``` + ----- + + another list +""" + expected_tokens = [ + "[ulist(1,1):+::2:]", + "[ulist(1,3):+::4: : \n \n \n]", + "[ulist(1,5):+::6: :\n\n]", + "[tbreak(1,7):-::-----]", + "[block-quote(2,7): : > \n > ]", + "[para(2,9):\n]", + "[text(2,9):block 1\nblock 2::\n]", + "[end-para:::True]", + "[end-block-quote:::True]", + "[end-ulist:::True]", + "[fcode-block(4,5):`:3:block:::::]", + "[text(5,5):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(7,5):-::-----]", + "[li(8,3):4: :]", + "[para(8,5):]", + "[text(8,5):another list:]", + "[end-para:::True]", + "[BLANK(9,1):]", + "[end-ulist:::True]", + "[end-ulist:::True]", + ] + expected_gfm = """""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=True) + + +@pytest.mark.gfm +def test_extra_049l4a(): + """ + TBD + """ + + # Arrange + source_markdown = """+ + + ----- + ```block + A code block + ``` + ----- + + another list +""" + expected_tokens = [ + "[ulist(1,1):+::2:]", + "[ulist(1,3):+::4: : \n \n \n \n]", + "[ulist(1,5):+::6: ]", + "[tbreak(1,7):-::-----]", + "[end-ulist:::True]", + "[fcode-block(2,5):`:3:block:::::]", + "[text(3,5):A code block:]", + "[end-fcode-block:::3:False]", + "[tbreak(5,5):-::-----]", + "[li(6,3):4: :]", + "[para(6,5):]", + "[text(6,5):another list:]", + "[end-para:::True]", + "[BLANK(7,1):]", + "[end-ulist:::True]", + "[end-ulist:::True]", + ] + expected_gfm = """""" + + # Act & Assert + act_and_assert(source_markdown, expected_gfm, expected_tokens, show_debug=True) + + +@pytest.mark.gfm +def test_extra_999(): + """ + Temporary test to keep coverage up while consistency checks disabled. + """ + + new_position = PositionMarker(1, 0, "text") + + new_block_quote = BlockQuoteMarkdownToken("", new_position) + ex_ws = new_block_quote.extracted_whitespace + assert not ex_ws + + new_front_matter = FrontMatterMarkdownToken("--", "--", ["a: b"], {}, new_position) + new_value = new_front_matter.calculate_block_token_height(new_front_matter) + assert new_value != 999 + new_value = new_front_matter.calculate_initial_whitespace() + assert new_value != 999 + assert new_front_matter.is_extension + + ParserHelper.count_newlines_in_texts("text") + + +# bad parsing +# bad_fenced_block_in_list_in_list_in_list_with_previous_block_double_drop + + +# Fix + +# Bad fix +# bad_fenced_block_in_list_in_list_in_list_with_previous_block_triple_drop_with_thematics +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_double_drop_and_thematics +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_double_drop +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_double_drop_with_thematics +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_triple_drop +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_block_triple_drop_with_thematics +# bad_fenced_block_in_list_in_list_with_previous_inner_block_double_drop_with_thematics +# bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_triple_drop_and_thematics +# bad_fenced_block_in_list_in_block_quote_in_list_with_previous_block_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_quad_drop_with_thematics +# bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_triple_drop_and_thematics +# bad_fenced_block_in_list_in_list_with_previous_inner_block_triple_drop_with_thematics +# bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_blockx_triple_drop +# bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_double_drop_and_thematics +# bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_double_drop_without_thematics +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_triple_drop_with_thematics +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_double_drop_with_thematics +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_triple_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_triple_drop_with_thematics +# bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_quad_drop_with_thematics +# bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_triple_drop_with_thematics +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list_triple_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_block_double_drop +# bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_triple_drop_and_thematics +# bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_block_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_double_drop_with_previous_inner_block +# bad_fenced_block_in_block_quote_with_previous_inner_list_double_drop + +# Assert +# bad_fenced_block_in_list_in_list_in_list_with_previous_list_double_drop +# bad_fenced_block_in_list_in_list_in_list_with_previous_list_triple_drop +# bad_fenced_block_in_list_in_list_in_list_with_previous_block_double_drop_with_thematics +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_double_drop +# bad_fenced_block_in_list_in_list_in_list_with_previous_block_triple_drop +# bad_fenced_block_in_list_in_list_in_block_quote_with_previous_list_triple_drop +# bad_fenced_block_in_list_in_list_with_previous_inner_block_double_drop +# bad_fenced_block_in_block_quote_in_list_in_list_with_previous_list_triple_drop +# bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_block_quad_drop +# bad_fenced_block_in_block_quote_in_list_in_list_with_previous_block_triple_drop +# bad_fenced_block_in_list_in_list_with_previous_inner_list_double_drop +# bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_blockx_double_drop +# bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_triple_drop_and_thematics +# bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_list_double_drop_and_thematics +# bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_triple_drop_with_thematics +# bad_fenced_block_in_block_quote_in_list_in_block_quote_with_previous_block_double_drop_with_thematics +# bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_list_quad_drop] +# bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_quad_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_list_quad_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_list_with_previous_inner_block_quad_drop +# bad_fenced_block_in_block_quote_in_list_with_previous_inner_list_triple_drop +# bad_fenced_block_in_block_quote_in_list_with_previous_inner_block_triple_drop +# bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_double_drop +# bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_triple_drop_with_thematics +# bad_fenced_block_in_block_quote_in_block_quote_in_block_quote_with_previous_block_triple_drop +# bad_fenced_block_in_list_with_previous_inner_block_double_drop