You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ! First, thanks for your work, it's very useful !!
Important
I think I found a bug with the header detection.
First, here is my markdown-lint configuration:
What's the problem
When two headers have the same content, but one is followed by a comment, they are considered different. Thus, when I create a link to a header that contains a comment, the MD051 rule is triggered.
Typically, I often use a comment next to the header to indicate that it should not be displayed in the table of contents (# ... <!-- omit in toc --> used by the Markdown All in One extension).
How to reproduce
Example of headers that should produce the same result:
Normally, the Header Example 3 should also trigger an error.
Example with the MD051 rule
Example with this header:
This link works (in the markdown preview), but the rule MD051 is triggered.
Conversely, this one does not work (in the markdown preview) but the rule MD051 is not triggered (because the header is followed by a comment and is therefore considered different).
The text was updated successfully, but these errors were encountered:
I'm not sure I agree the first example is wrong, but it definitely depends on whether one considers the content of the comment as part of the heading or not. I may decide it should be ignored as you suggest, but I'll need to think about that more. Your second example does not appear to be a bug because that rule honors the GitHub implementation and the GitHub-generated link for a heading followed by a comment includes the trailing dash.
Hi ! First, thanks for your work, it's very useful !!
Important
I think I found a bug with the header detection.
First, here is my
markdown-lint
configuration:What's the problem
When two headers have the same content, but one is followed by a comment, they are considered different. Thus, when I create a link to a header that contains a comment, the
MD051
rule is triggered.Typically, I often use a comment next to the header to indicate that it should not be displayed in the table of contents (
# ... <!-- omit in toc -->
used by the Markdown All in One extension).How to reproduce
Example of headers that should produce the same result:
Normally, the
Header Example 3
should also trigger an error.Example with the MD051 rule
Example with this header:
This link works (in the markdown preview), but the rule
MD051
is triggered.Conversely, this one does not work (in the markdown preview) but the rule
MD051
is not triggered (because the header is followed by a comment and is therefore considered different).The text was updated successfully, but these errors were encountered: