Skip to content

MD031 Fix mode: Handle leading spaces assertion in __fix_spacing #1243

@jackdewinter

Description

@jackdewinter

Prerequisites

  • Are you running the latest version of this application?
  • Have you checked the Frequently Asked Questions document?
  • Have you simplified the bug report to the essential details?
    • Do you have a distinct command line to report?
    • Can you clearly state the configuration for this bug report?
    • Do you have a minimal document that highlights this bug?
    • Are any required files (configuration or Markdown document) attached to the issue?
  • Did you perform a cursory search of other issues to look for related issues?

Bug Report

Bug Type

  • Fix/Rule not working as expected

Description

When executing certain "drop_x" tests, the following critical error is encountered:

  File "C:\enlistments\pymarkdown\pymarkdown\plugins\rule_md_031.py", line 483, in __fix_spacing
    assert removed_list_token.leading_spaces is None
AssertionError

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_with_previous_inner_block_triple_drop is one example

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.

No

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

bad_fenced_block_in_list_in_block_quote_with_previous_inner_block_triple_drop

Actual Behavior

When the above test (and 9 others) is executed, the assert causes a critical error.

Expected Behavior

The code on line 483 of the rule was commented out as there was no data to support that path. As these 10 tests provide that data, the code can be properly uncommented to handle the scenario properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions