[GH-ISSUE #1524] MD052 triggered by selected checkbox in github flavoured markdown #2549

Closed
opened 2026-03-07 20:08:48 +03:00 by kerem · 6 comments
Owner

Originally created by @deosrc on GitHub (Mar 2, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1524

As per the title, MD052 is being triggered by selected checkboxes in github flavoured markdown:

- [x] Checked item
MD052/reference-links-images Reference links and images should use a label that is defined [Missing link or image reference definition: "x"] [Context: "[x]"]
Originally created by @deosrc on GitHub (Mar 2, 2025). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1524 As per the title, MD052 is being triggered by selected checkboxes in github flavoured markdown: ```markdown - [x] Checked item ``` ```text MD052/reference-links-images Reference links and images should use a label that is defined [Missing link or image reference definition: "x"] [Context: "[x]"] ```
kerem 2026-03-07 20:08:48 +03:00
Author
Owner

@deosrc commented on GitHub (Mar 2, 2025):

Realised this was caused by this configuration I coped from https://github.com/DavidAnson/markdownlint/blob/main/.markdownlint.json

  "reference-links-images": {
    "shortcut_syntax": true
  },
<!-- gh-comment-id:2692899264 --> @deosrc commented on GitHub (Mar 2, 2025): Realised this was caused by this configuration I coped from https://github.com/DavidAnson/markdownlint/blob/main/.markdownlint.json ```json "reference-links-images": { "shortcut_syntax": true }, ```
Author
Owner

@DavidAnson commented on GitHub (Mar 2, 2025):

Is there anything to indicate this is supposed to be a checkbox instead of being a missing reference definition as is being reported? Should every instance of [x] be ignored in case it could be a checkbox? For my own future reference, maybe this is only meaningful as the first thing of a list item? https://github.blog/news-insights/product-news/task-lists-in-gfm-issues-pulls-comments/

<!-- gh-comment-id:2692899641 --> @DavidAnson commented on GitHub (Mar 2, 2025): Is there anything to indicate this is supposed to be a checkbox instead of being a missing reference definition as is being reported? Should every instance of `[x]` be ignored in case it could be a checkbox? For my own future reference, maybe this is only meaningful as the first thing of a list item? https://github.blog/news-insights/product-news/task-lists-in-gfm-issues-pulls-comments/
Author
Owner

@DavidAnson commented on GitHub (Mar 2, 2025):

I think this is a scenario where you should disable the rule (at least for now) - you can use inline comments to do so for just the TODO list.

<!-- gh-comment-id:2692900285 --> @DavidAnson commented on GitHub (Mar 2, 2025): I think this is a scenario where you should disable the rule (at least for now) - you can use inline comments to do so for just the TODO list.
Author
Owner

@DavidAnson commented on GitHub (Mar 2, 2025):

Realised this was caused by this configuration I coped from ...

Good point! I configure it to be extra picky, so this shouldn't be seen by default. Thanks for calling that out.

<!-- gh-comment-id:2692901236 --> @DavidAnson commented on GitHub (Mar 2, 2025): > Realised this was caused by this configuration I coped from ... Good point! I configure it to be extra picky, so this shouldn't be seen by default. Thanks for calling that out.
Author
Owner

@deosrc commented on GitHub (Mar 2, 2025):

Thanks, yes I've disabled the rule.

A quick test suggests checkboxes only work in lists:

[ ] Not a checkbox
[x] Not a checkbox

- [ ] Checkbox
- [x] Selected checkbox 

[ ] Not a checkbox
[x] Not a checkbox

  • Checkbox
  • Selected checkbox

A reference link of [x] would seem unlikely, until a major social media site had a rename.

<!-- gh-comment-id:2692904838 --> @deosrc commented on GitHub (Mar 2, 2025): Thanks, yes I've disabled the rule. A quick test suggests checkboxes only work in lists: ```markdown [ ] Not a checkbox [x] Not a checkbox - [ ] Checkbox - [x] Selected checkbox ``` --- [ ] Not a checkbox [x] Not a checkbox - [ ] Checkbox - [x] Selected checkbox --- A reference link of `[x]` would seem unlikely, until a major social media site had a rename.
Author
Owner

@DavidAnson commented on GitHub (Mar 2, 2025):

Haha! FYI, I think you can opt out of the customization from my configuration and keep the rule on but skip the strict shortcut behavior I enabled. (I'm not sure if that was clear.) Thanks for doing that bit of research!

<!-- gh-comment-id:2692931355 --> @DavidAnson commented on GitHub (Mar 2, 2025): Haha! FYI, I think you can opt out of the customization from my configuration and keep the rule on but skip the strict shortcut behavior I enabled. (I'm not sure if that was clear.) Thanks for doing that bit of research!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2549
No description provided.