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

MD049: Incorrectly detecting [[_TOC_]] #734

Open
Prefix42 opened this issue Mar 3, 2023 · 3 comments
Open

MD049: Incorrectly detecting [[_TOC_]] #734

Prefix42 opened this issue Mar 3, 2023 · 3 comments

Comments

@Prefix42
Copy link

Prefix42 commented Mar 3, 2023

Problem Description

Rule MD049 incorrectly detects the the Azure Devops markdown tag to auto generate a table of contents

Issue

Azure Devops uses the tag [[_TOC_]] to auto generate a table of contents at render. The tag must match case and syntax exactly or will be rendered as the litteral text. As the tag uses a prefix and suffix of underscore (_) the rule MD049 incorrectly detects the use of underscore as the emphasis style of the document.

Proposal

Exclude "[[TOC]]" from emphasis evaluation

Impacted version(s)

v0.27.0

Supporting Documentation

Markdown syntax for wikis

@DavidAnson
Copy link
Owner

This construct is not part of the CommonMark specification, so it is reasonable for it to be flagged. That said, your example does not seem to generate a violation: https://dlaa.me/markdownlint/#%25m%23%20Issue%20734%0A%0A%5B%5B_TOC_%5D%5D%0A

@Prefix42
Copy link
Author

Prefix42 commented Mar 3, 2023

Thank you for the super prompt response.

My apologies for the poor explanation and lack of example. Please see the following for a better demonstration of the issue.
https://dlaa.me/markdownlint/#%25m%23%20Issue%20734%0A%0A%5B%5B_TOC_%5D%5D%0A%0A*foo*%0A_bar_%0A

In regards to being outside of the CommonMark specification I completely understand but figured it never hurts to ask,

@DavidAnson
Copy link
Owner

Thank you! I don't like adding special cases for weird stuff like this, but I see why it's annoying in your scenario. I'll leave this open to think about.

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

No branches or pull requests

2 participants