mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 09:46:01 +03:00
[GH-ISSUE #957] Bug with MD052 and Hugo Shortcodes #2416
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#2416
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 @j-maynard on GitHub (Sep 7, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/957
Hi Peoples
I think I've found a bug in the way rule MD052 is processed. In my markdown files I have the following snippet:
With the references at the end of the markdown being:
Items 4 and 3 are Hugo shortcodes which produce valid URLs but I think because of the way markdownlint processes this section it throws an MD052 error. My exact error is:
Would it be possible to confirm the bug and advise if you might fix it so I can advise my handbook community and make a decision on if I should disable the rule in my project (not something I want to do).
@DavidAnson commented on GitHub (Sep 7, 2023):
Hugo shortcodes are not part of the CommonMark/GFM specification which this tool uses. If you run this tool against the example as you show, the issues reported are correct because 3 and 4 are not valid link definitions. If you were to run this tool against the output after Hugo had processed the above and expanded its shortcodes, 3 and 4 should become valid link definitions and no issues should be reported. I do not consider this a bug.
@j-maynard commented on GitHub (Sep 7, 2023):
Cool... Thank you for taking a look. I'd throw out a feature request to add shortcode support in the future.
I'll disable the rule in our config as I think this going to come up a lot for our Handbook. I'll close the issue.