Skip to content

Fix mode: BadPluginFixError "Multiple plugins (MD029 and MD031) are in conflict" on an ordered list resuming after a heading with an unspaced fenced block #1672

Open

Description

@c-vigo

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 an ordered list resumes its numbering after a heading (a common "phased
runbook" style, so the first item of the second list is e.g. 3.) and one
of its items contains a fenced code block without surrounding blank lines,
fix mode aborts the whole file with a hard error instead of fixing or
skipping:

BadPluginFixError encountered while scanning 'conflict.md':
Multiple plugins (MD029 and MD031) are in conflict about fixing the token.

Both trigger conditions are needed: with sequential 1..n numbering the same
document fixes fine, and with blank lines already around the fence it also
fixes fine. This looks related to, but simpler than, the nested-container
scenarios tracked in #1274 / #1442 — here the fence sits in a plain top-level
ordered list, no block quotes or nesting involved.

In a real-world tree (a NixOS fleet repo with ~70 Markdown runbooks/ADRs) this
idiom occurred in 6 of 73 documents, making fix unusable tree-wide until the
blank lines were inserted by hand.

Specifics

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

NixOS (Linux x86_64). Also reproduced in a clean uvx environment.

What version are you seeing this behavior in?

Reproduced identically on 0.9.23 and 0.9.39 (latest at time of
writing, installed via uvx --from pymarkdownlnt==0.9.39).

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

None.

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

pymarkdown fix conflict.md

Are you using a configuration file?

No — default configuration.

What Markdown document causes this behavior to manifest?

conflict.md (attached, 14 lines):

# Repro

## Phase A

1. Step one.
2. Step two.

## Phase B

3. Step three:
   ```sh
   echo three
   ```
4. Step four.

Actual Behavior

BadPluginFixError encountered while scanning 'conflict.md':
Multiple plugins (MD029 and MD031) are in conflict about fixing the token.

Exit code 1; the file is left unmodified but the whole fix run for that file
is aborted, so none of its other fixable violations are fixed either.

Expected Behavior

Either (a) the two plugins fix in a defined order across passes (MD031 inserts
the blank lines, MD029 renumbers on a later pass or vice versa), or (b) the
conflicting fix is skipped for that token and reported as an ordinary
"could not fix" diagnostic for the affected rules. A single rule conflict
should not turn into a hard BadPluginFixError that aborts the file: in a
pre-commit context this makes the hook unpassable on content that
scan handles without complaint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions