mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #1274] MD051: Add an option to ignore case for automatically-generated heading identifiers #654
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#654
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 @Stardidi on GitHub (Jun 26, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1274
The example from the documentation reports
MD051/link-fragments: Link fragments should be valid [Expected #heading-name; Actual: #Heading-Name]I expect the behavior as described in the example. The actual logic appears to have a bug.
@DavidAnson commented on GitHub (Jun 26, 2024):
The documentation you link explains why the example you show is reported as a violation:
@DerGary commented on GitHub (Aug 21, 2024):
Why is this example wrong? It exactly matches the case, so when the link anchor is treated case-sensitive than an exactly matching case should be valid and no violation! Is there a way to change the behaviour of this rule to ignore case or match case exactly??
@DavidAnson commented on GitHub (Aug 21, 2024):
As noted above, this rule matches the GitHub algorithm and that algorithm converts heading text to lower case. Work could be done here to allow mIxEd CaSe, but that would permit inconsistency without adding any functionality.
@DerGary commented on GitHub (Aug 21, 2024):
I understood that it implements the GitHub algorithm but the wording in the documentation that
Link fragments may be handled case-sensitivelyis misleading. For me this reads like thisbecause link fragments can be handled either case sensitive or case insensitive we implemented the GitHub algorithm which handles everyting case sensitiveI will add some background why we stumbled upon this:
We write documentation in markdown and then we use mark to upload the documentation to Atlassian Confluence. Because Confluence is handling anchor links case sensitive this is a bit of a problem because we can't meet both requirements. I already added an issue to mark maybe they can transform the links on generation
@Stardidi commented on GitHub (Aug 24, 2024):
The parsers we use are also case-sensitive, so that enhancement would help. But they also handle whitespace differently, so maybe not sufficiently...
However I had indeed read this documentation wrong, I read it as
different markdown implementations handle case sensitivity differently, so we support both, this was reinforced by may of the other examples being correct markdown and this one being incorrect. Maybe some ✅ and ❌ in the docs could help accentuate when something is valid/invalid?>character #2340