mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #622] MD013: Text *after* url #2331
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#2331
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 @barrettruth on GitHub (Oct 30, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/622
So, going off of this issue, I actually don't seem to have false positives with urls.
However, I do get errors on lines with text after a url. I'm not sure if this was a purposeful error though.

(Note that in the screenshot the blue "here" is concealed text -- the line is indeed longer than 80 chars).
Is this intentional? I would expect line lengths to be calculated by summing the "url" text and all other characters and then testing that length against 80. Instead, normal urls exceeding 80 characters are (correctly) not linted, butothers with text after are.
@DavidAnson commented on GitHub (Oct 30, 2022):
I can't tell much from that screenshot, sorry. Could you please paste the text of a complete reproduction or link to a file that demonstrates this? If it helps, you might find the web demo handy: https://dlaa.me/markdownlint/
@barrettruth commented on GitHub (Oct 30, 2022):
Sorry, here you go.
@DavidAnson commented on GitHub (Oct 30, 2022):
Your example produces no errors in the current release of the library: https://dlaa.me/markdownlint/#%25m%23%20Markdownlint%20Explanation%0A%0A%5Bcorrectly%20non-linted%20line%20technically%20longer%20than%2080%20chars%20including%20url%20length%5D(https%3A%2F%2Fakfdjajdf.asdfljbadfjladsfadsjfbafbjhbflajdf)%0A%0A%5Bline%20starting%20with%20url%5D(https%3A%2F%2Fwiki.archlinux.org)%20incorrectly%20linted%20despite%20being%20less%20than%2080%20chars%0A
@DavidAnson commented on GitHub (Oct 30, 2022):
My mistake, MD013 is off by default in the web demo. Here is your example with it enabled and reporting: https://dlaa.me/markdownlint/#%25m%23%20Markdownlint%20Explanation%0A%0A%3C!--%20markdownlint-enable%20MD013%20--%3E%0A%0A%5Bcorrectly%20non-linted%20line%20technically%20longer%20than%2080%20chars%20including%20url%20length%5D(https%3A%2F%2Fakfdjajdf.asdfljbadfjladsfadsjfbafbjhbflajdf)%0A%0A%5Bline%20starting%20with%20url%5D(https%3A%2F%2Fwiki.archlinux.org)%20incorrectly%20linted%20despite%20being%20less%20than%2080%20chars%0A
@DavidAnson commented on GitHub (Oct 30, 2022):
In your example, the error reported for line 7 is "Line length [Expected: 80; Actual: 104]". That line is indeed 104 characters long in Markdown, so this seems correct. (The length is shorter when rendered, but this rule runs on the original Markdown source.)
@barrettruth commented on GitHub (Oct 30, 2022):
So my question is why is the first line not linted as well then? It's evidently much longer than 80 chars. Why only the second?
@nschonni commented on GitHub (Oct 30, 2022):
The rule is because of the 80 char wrapping rule from old IDE/diff editors, not the visual representation. When the part that exceeds the 80 chars is a link text, it doesn't complain for the reasons explained in the docs https://github.com/DavidAnson/markdownlint/blob/v0.26.2/doc/Rules.md#md013
@DavidAnson commented on GitHub (Oct 30, 2022):
That's right. To put it a little differently, this rule tries to help you keep Markdown content to within a particular line length, but doesn't force you to break up long content like a link.
@barrettruth commented on GitHub (Oct 31, 2022):
Ah ok. So by erroring on the second line it is indicating you should "break up" the line because it ends on text -- if it is a url then it assumes you don't.
Odd, but i guess I get it. The "80 char" width definitely isn't an old thing, though. It is still standard practice in many common code formatters.