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

Create a max-heading-level rule #86

Open
iansan5653 opened this issue Oct 6, 2023 · 2 comments
Open

Create a max-heading-level rule #86

iansan5653 opened this issue Oct 6, 2023 · 2 comments

Comments

@iansan5653
Copy link
Member

iansan5653 commented Oct 6, 2023

When Markdown content is rendered on GitHub, it is rendered into the context of a webpage. This means there is already an external heading structure to contend with.

In issue and PR comments, the maximum heading level that should be used is 3 (###). In files in Code View, the maximum should be 2 (##).

I think it's debatable whether Markdown files should be written with their intended viewing location in mind - Markdown is supposed to be a rendering-agnostic markup format. But comments should probably always be written like this. So I think it would be useful to make a new rule available, but disable it by default.

I propose we make this generic, allowing the linter to customize the heading level for the situation. For example, the following configuration would be for comments on github.com:

{
    "max-heading-level": {
        "level": 3
    }
}

Related:

@andrialexandrou
Copy link
Collaborator

I think this is an interesting rule to provide, and I agree it should be disabled by default. Consumers might also want to singularly import this rule even if they're not using the full accessibility set.

I might propose using the naming of start-heading-level rather than use max or min, but that's purely an ergonomic consideration.

@iansan5653
Copy link
Member Author

If we do decide to add this rule here, I've written it in github-markdown-a11y-extension as start-heading-level - we can definitely copy/paste it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants