Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heading-style "consistent" does not select setext_with_atx #154

Closed
arwedus opened this issue Nov 24, 2021 · 2 comments · Fixed by #279
Closed

heading-style "consistent" does not select setext_with_atx #154

arwedus opened this issue Nov 24, 2021 · 2 comments · Fixed by #279
Labels
enhancement New feature or request

Comments

@arwedus
Copy link

arwedus commented Nov 24, 2021

Hi @jackdewinter , I tried pymarkdownlint on a project where people use either setext_with_atx or atx style.

Config:

{
        "md003": {
            "style" : "consistent"
        }
}

Problem:

On this document, I get a warning md003 " Heading style should be consistent throughout the document. [Expected: setext; Actual: atx] (heading-style,header-style)":

Title
=====

Section 1
---------

### Subsection

Some text...

markdownlint has the same issue, but my point here is:

I would be very glad if rule md003 would detect the setext_with_atx style, because there is simply no other way to have headings of level 3 and below than with ATX (unlike in restructuredText).

Implementation is probably simple: If you encounter setext, just ignore headings L3+ (it can only be ATX, after all), or switch to setext_with_atx the first time the parser encounters a L3 ATX heading.

@jackdewinter jackdewinter added the enhancement New feature or request label Nov 26, 2021
@jackdewinter
Copy link
Owner

@arwedus Sorry it took me so long to get to this.

{"plugins": {"md003": {"allow-setext-update": True}}}

I just added a new setting for rule Md003, allow-setext-update which does what you have asked for.

@arwedus
Copy link
Author

arwedus commented Apr 20, 2022

@jackdewinter: Sorry, been a while. Just wanted to say thanks a lot for implementing what I requested! I'll give it a try right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants