Skip to content

Commit

Permalink
Issue 786 (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdewinter authored Oct 28, 2023
1 parent bb5a017 commit a02b9f4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ That experimentation lead to a couple of changes:
determine validity
- changed rule `md001` to look for case sensitive front-matter key name instead
of case sensitive per switch to full YAML processing
- [Issue 791](https://github.com/jackdewinter/pymarkdown/issues/791)
- html blocks inside of 2+ levels of block quote was asserting
- slight change to surrounding code to deal with less than case

## Version 0.9.13.4 - Date: 2023-09-09

Expand Down
5 changes: 4 additions & 1 deletion pymarkdown/block_quotes/block_quote_count_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def count_block_quote_starts(
start_index -= 1
else:
osi, oltp, current_count = start_index, line_to_parse[:], 1
POGGER.debug("cbqs1-current_count--$--", current_count)
start_index += 1

POGGER.debug(
Expand Down Expand Up @@ -116,9 +117,11 @@ def count_block_quote_starts(
avoid_block_starts,
last_block_quote_index,
)
POGGER.debug("cbqs2-current_count--$--", current_count)
if not continue_processing:
break
current_count += 1
POGGER.debug("cbqs3-current_count--$--", current_count)
start_index += 1
last_block_quote_index = start_index

Expand Down Expand Up @@ -168,7 +171,7 @@ def __should_continue_processing(
stack_count,
is_top_of_stack_is_html_block,
)
if is_top_of_stack_is_html_block:
if is_top_of_stack_is_html_block and current_count >= stack_count:
if current_count == stack_count:
POGGER.debug(
"block quote levels don't increase during html block, ignoring"
Expand Down
41 changes: 41 additions & 0 deletions test/test_markdown_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -4465,6 +4465,47 @@ def test_extra_031x():
)


@pytest.mark.gfm
def test_extra_032():
"""
TBD - from test_md010_bad_xxx
test_markdown_with_config_json_configuration_file
"""

# Arrange
scanner = MarkdownScanner()
stdin_to_use = """> > <html>
> > <script>
> > <!-- some script stuff -->
> > </script>
> > </html>
"""

supplied_arguments = [
# "--log-level",
# "DEBUG",
"--stack-trace",
"-d",
"md033,md041",
"scan-stdin",
]

expected_return_code = 0
expected_output = ""
expected_error = ""

# Act
execute_results = scanner.invoke_main(
arguments=supplied_arguments, standard_input_to_use=stdin_to_use
)

# Assert
execute_results.assert_results(
expected_output, expected_error, expected_return_code
)


@pytest.mark.gfm
def test_extra_999():
"""
Expand Down

0 comments on commit a02b9f4

Please sign in to comment.