jackdewinter / pymarkdown

MIT License
75 stars 17 forks source link

MD031 Fix mode: Handle leading spaces assertion #1245

Closed jackdewinter closed 3 weeks ago

jackdewinter commented 3 weeks ago

Prerequisites

Bug Report

Bug Type

Description

In a couple of small areas during md031 fix mode, "leading spaces" asserts were triggered.

Specifics

What operating system and version are you running into this behavior on?

Win11

What version are you seeing this behavior in? (Run pip list or pipenv run pip list and look for the entry beside pymarkdownlnt.)

latest, main

Are there any extra steps that need to be taken before executing the application?

No

What is the command line you invoke to get this behavior?

bad_fenced_block_in_list_in_block_quote_in_block_quote_with_previous_list_double_drop bad_fenced_block_in_list_in_block_quote_in_list_with_previous_list_double_drop bad_fenced_block_in_list_in_block_quote_with_previous_inner_list_double_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_list_double_drop

Are you using a configuration file? Either on the command line or one of the implicit configuration files? If so, attach that file to this issue.

N/A

What Markdown document causes this behavior to manifest? Attach that file to this issue.

See command line above.

Actual Behavior

In all the above cases, an assert was added for MyPy to protect against usage of an optional str with a value of None. These triggered the asserts, noting that we have a new use case that demonstrates the need for handling of that case.

Expected Behavior

These cases should be handled properly.