DavidAnson / vscode-markdownlint

Markdown linting and style checking for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
MIT License
930 stars 170 forks source link

Feature: [MD049] Ignores style of TableOfContent #298

Closed cloudy81 closed 1 year ago

cloudy81 commented 1 year ago

When using Markdown files for azure devops we need to add table of content with following style image

But the check of MD049 shows than inconstancy
image

Is it possible to ignore table of content for check

cloudy81 commented 1 year ago

@DavidAnson I have seen the same question here.

I tried also to suppress it image

Would be nice to have a solution for that Maybe a possibility to ignore a line image

DavidAnson commented 1 year ago

This is a duplicate as you point out. Also, <!-- markdownlint-disable-next-line --> already exists: https://github.com/DavidAnson/markdownlint#configuration

DavidAnson commented 1 year ago

Actually, it's not a duplicate issue because the issue you link to above is about parsing before the table of contents is inserted and yours seems to be about parsing after it is inserted. From what I see of your example, the ability to disable rules for the next line will not be helpful here because you are examining code after the expansion and it contains multiple lines. In your case, the issues reported are correct that the emphasis style of asterisk is being used. If you have previously used the underscore style, then this is legitimately inconsistent. You could standardize on the asterisk form instead, change the TOC generator to produce underscores in the table of contents, or disable this rule for that part of the document or for your project.