[GH-ISSUE #326] Add reference link whitespace style rule #280

Open
opened 2026-03-03 01:25:23 +03:00 by kerem · 0 comments
Owner

Originally created by @leetrout on GitHub (Aug 31, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/326

CommonMark deviates from this and says it is optional but it is mentioned explicitly in the original Daring Fireball docs:

Then, anywhere in the document, you define your link label like this, on a line by itself:

[id]: http://example.com/ "Optional Title Here"

That is:

Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces);
followed by a colon;
followed by one or more spaces (or tabs);
followed by the URL for the link;
optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses.


With a new rule to enforce at least one unit of whitespace (including a newline, per CommonMark)

  • This would fail:

    • [link-to-somewhere]:http://link-to-somewhere
  • This would pass:

    • [link-to-somewhere]: http://link-to-somewhere
Originally created by @leetrout on GitHub (Aug 31, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/326 [CommonMark deviates from this](https://spec.commonmark.org/0.29/#link-reference-definition) and says it is optional but it is mentioned explicitly in the original [Daring Fireball](https://daringfireball.net/projects/markdown/syntax#link) docs: > Then, anywhere in the document, you define your link label like this, on a line by itself: > > `[id]: http://example.com/ "Optional Title Here"` > > That is: > > Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces); > followed by a colon; > followed by one or more spaces (or tabs); > followed by the URL for the link; > optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses. ------ With a new rule to enforce at least one unit of whitespace (including a newline, per CommonMark) - This would fail: - `[link-to-somewhere]:http://link-to-somewhere` - This would pass: - `[link-to-somewhere]: http://link-to-somewhere`
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#280
No description provided.