mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #1118] Question: New MD051 warnings upgrading from v14 to v15 #2463
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2463
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CodeBlanch on GitHub (Feb 1, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1118
Hey @DavidAnson!
When we bump from v14 to v15 we are getting new MD051 warnings: https://github.com/open-telemetry/opentelemetry-dotnet/actions/runs/7716090575/job/21032134820?pr=5290#step:3:13
The fragments seem fine from what I can gather. Is this expected?
/cc @alanwest
@DavidAnson commented on GitHub (Feb 1, 2024):
Sorry, I can't tell why this rule is complaining from my phone, but my guess is the inline code span is interfering. I'll try to have a look soon. You may want to disable that rule for that file temporarily if it's blocking PRs.
@CodeBlanch commented on GitHub (Feb 1, 2024):
@DavidAnson Just FYI we worked around the issue by tweaking the markdown here: https://github.com/open-telemetry/opentelemetry-dotnet/pull/5306
@DavidAnson commented on GitHub (Feb 2, 2024):
Great, thanks for letting me know! I swear those backticks were in the file I looked at, so I may have picked the wrong file on my phone due to the small screen and seemingly many similar file names. Based on the file I saw, I think you wanted those backticks you just added anyway, so maybe this is a blessing in disguise. :) I will go on and have a look at why this happened, though.
@DavidAnson commented on GitHub (Feb 2, 2024):
Okay, this isn't a bug in
markdownlint.Here's one of the "before" headings from your change: https://dlaa.me/markdownlint/#%25m%23%20Issue%201118%0A%0A%23%23%20ConventionalRouting%3A%20Area%20using%20area%3Aexists%2C%20default%20controller%2Faction%0A
Note that it renders weird - that's because
:existsis treated as an inline Markdown directive which is newly supported in the latest release ofmarkdownlint. You can read more here: https://github.com/micromark/micromark-extension-directiveDirectives are for extending, so the tool doesn't know if a particular one is valid or not. If the parser sees valid directive syntax, it treats it as a directive. Which means the heading above doesn't say what it looks like it says and there's a mis-match so MD051 rightly triggers.
Now, I would have assumed a directive needed to be preceded by a space character, but I don't see that called out in the "spec": https://talk.commonmark.org/t/generic-directives-plugins-syntax/444
If you want to read that whole discussion, be my guest. If you find there's supposed to be a space, we can log that as an issue against the
micromarkcode. But I don't see this as an open/closed issue there, so I suspect it is deliberate.Your change to put the relevant text in an inline code span avoids the issue by taking the colon/text out of the normal flow.
Unless you feel otherwise, I will close this as "by design". Thanks for reporting it!