mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 09:46:01 +03:00
[GH-ISSUE #552] Newer versions of markdown lint complain about links that wrap to a new line #450
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#450
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 @michaelgwelch on GitHub (Aug 13, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/552
I'm coming from an older version of markdownlint: 0.8.1.
Our repo uses prettier to format all documents with
proseWrap: alwaysconfigured. This has the effect of wrapping links.For example here's a link we have in our doc:
It wasn't written this way but prettier formats it this way. With 0.8.1 markdownlint didn't issue any warning or error. With the latest version (0.26.2) which I just upgraded to, we now get an error:
Which seems like a MD052 violation.
I think (at least based upon the common mark spec) that a line break is allowed (bolding added by me):
There is an open issue on the prettier repo but it doesn't seem to have much traction.
https://github.com/prettier/prettier/issues/9232
@DavidAnson commented on GitHub (Aug 13, 2022):
A new line in that position is expressly allowed by the specification: https://spec.commonmark.org/0.30/#example-198
However, it is annoying for my purposes. I will look to update the library to stop reporting this pattern as a violation.
@michaelgwelch commented on GitHub (Aug 13, 2022):
Yeah, I can see that. I was just looking at the following function and while you do concatenate all the lines for "single-line exclusions for inline code spans" it's back to line by line for links:
github.com/DavidAnson/markdownlint@2488a5c0ce/helpers/helpers.js (L782)@DavidAnson commented on GitHub (Aug 13, 2022):
Waaaait a minute. I remembered that regular expression as wanting to match part of the link, but it does not.
Trying your example in the demo app works fine for me: https://dlaa.me/markdownlint/#%25m%23%20Issue%20552%0A%0ASee%20%5Bhttp%20403%20forbidden%5D.%0A%0A%5Bhttp%20403%20forbidden%5D%3A%0A%20%20https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FStatus%2F403%0A
Can you show me the document where this is failing for you? There may be something else going on.
@michaelgwelch commented on GitHub (Aug 13, 2022):
@DavidAnson My apologies. The error I'm getting is MD053 and is triggering exactly for the reason it should. The link in question is not used. (I'm not the author of the document this triggered on and I had just assumed all the links in it were used, and therefore assumed the issue was due to the formatting)