Skip to content

[MD077] Use MkDocs indentation even in Commonmark documents #784

Description

@skyzyx

Problem or motivation

I use rumdl alongside editorconfig-checker, which is a tool that enforces that documents follow the .editorconfig configuration.

When applied to .md documents with indent = 2, this means that second lines must be indented 4 spaces, then 6, etc. My documents are GFM documents, and to pass the editorconfig-checker check, next lines must be 4 spaces. However MD077 instructs Commonmark documents to use 3 spaces. If it were an MkDocs document, it could be 4. But there does not seem to be a way to instruct rumdl to use 4 spaces intentionally.

This causes a conflict during the linting/fixing stage of my development pipeline with tools arguing with each other.

Proposed solution

  • Let .editorconfig override what MD077 validates against.
  • Allow Commonmark documents to use MkDocs indentation rules.
  • Allow the user to somehow specify $2n$, $3n$, $4n$, …, etc., where $n$ is the indentation level.

Alternatives considered

Disable MD077.

Feature category

Improve existing rule

Example markdown

This is what is expected by rumdl with 2-space indentation and a second line for a Commonmark document.

* This is a sentence in a list item.

   This is a second sentence in a list item.

This is what I'd like to achieve as a valid configuration.

* This is a sentence in a list item.

    This is a second sentence in a list item.

Contribution

  • I would be willing to submit a PR to implement this feature

Additional context

I haven't learned Rust yet. Sorry.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions