[GH-ISSUE #370] MD042 (No empty links) trips on notes #310

Closed
opened 2026-03-03 01:25:37 +03:00 by kerem · 2 comments
Owner

Originally created by @GoodClover on GitHub (Feb 20, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/370

In some markdown flavours notes can be created:

Here[^1] is some text[^md], I hope you enjoy[^note][^2] reading it!

[^md]: Markdown formatted text to be specific.
[^1]: 'ere 'ere
[^2]: If you're a human that is.

image

You can use a cheap hack to make this work in other flavours1 by adding <> to it so it will be treat as a link and using "" to make the note a title.

... other flavours[^gh-markdown] by ...

[^gh-md]: <> "Like here on GitHub."

However using <> trips up MD042 (No empty links).
I think it would be good if MD042 didn't include empty links with titles.

Or, even better, have an error saying that you should be doing it with the footnote syntax.


  1. <> "Like here on GitHub." ↩︎

Originally created by @GoodClover on GitHub (Feb 20, 2021). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/370 In some markdown flavours notes can be created: ```markdown Here[^1] is some text[^md], I hope you enjoy[^note][^2] reading it! [^md]: Markdown formatted text to be specific. [^1]: 'ere 'ere [^2]: If you're a human that is. ``` ![image](https://user-images.githubusercontent.com/27222523/108600626-0289c400-7390-11eb-9bc4-16ea9d900d88.png) You can use a cheap hack to make this work in other flavours[^gh-md] by adding `<>` to it so it will be treat as a link and using `""` to make the note a title. [^gh-md]: <> "Like here on GitHub." ```markdown ... other flavours[^gh-markdown] by ... [^gh-md]: <> "Like here on GitHub." ``` However using `<>` trips up `MD042` (No empty links). I think it would be good if `MD042` didn't include empty links with titles. Or, even better, have an error saying that you should be doing it with the footnote syntax.
kerem 2026-03-03 01:25:37 +03:00
Author
Owner

@DavidAnson commented on GitHub (May 1, 2022):

GitHub now supports footnotes: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/

I'll focus on that syntax and am having a look now.

<!-- gh-comment-id:1114109234 --> @DavidAnson commented on GitHub (May 1, 2022): GitHub now supports footnotes: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/ I'll focus on that syntax and am having a look now.
Author
Owner

@DavidAnson commented on GitHub (May 1, 2022):

The GitHub syntax seems to match what you show in the original comment above and does not produce any warnings in the next version of the library (nor in the current, though I only checked briefly). I've added a test file to ensure that remains true.

<!-- gh-comment-id:1114110694 --> @DavidAnson commented on GitHub (May 1, 2022): The GitHub syntax seems to match what you show in the original comment above and does not produce any warnings in the next version of the library (nor in the current, though I only checked briefly). I've added a test file to ensure that remains true.
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#310
No description provided.