[GH-ISSUE #379] MD013 false positive with ul, checkbox, link, and italicized trailing text #2166

Closed
opened 2026-03-07 20:05:11 +03:00 by kerem · 4 comments
Owner

Originally created by @hepcat72 on GitHub (Mar 24, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/379

It seems to me that the following should not generate a MD013 error:

Generates an error:

- [ ] [Migrations created & committed](https://github.com/Princeton-LSI-ResearchComputing/tracebase/blob/main/CONTRIBUTING.md#migration-process) *(or no model changes)*

Since this does not generate an error:

Does not generate an error:

- [ ] [Migrations created & committed *(or no model changes)*](https://github.com/Princeton-LSI-ResearchComputing/tracebase/blob/main/CONTRIBUTING.md#migration-process)
- [ ] [Tests implemented](https://github.com/Princeton-LSI-ResearchComputing/tracebase/blob/main/CONTRIBUTING.md#test-implementation)

Error:

.github/pull_request_template.md:29:81 MD013/line-length Line length [Expected: 80; Actual: 167]
Originally created by @hepcat72 on GitHub (Mar 24, 2021). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/379 It seems to me that the following should not generate a `MD013` error: Generates an error: ``` - [ ] [Migrations created & committed](https://github.com/Princeton-LSI-ResearchComputing/tracebase/blob/main/CONTRIBUTING.md#migration-process) *(or no model changes)* ``` Since this does not generate an error: Does not generate an error: ``` - [ ] [Migrations created & committed *(or no model changes)*](https://github.com/Princeton-LSI-ResearchComputing/tracebase/blob/main/CONTRIBUTING.md#migration-process) - [ ] [Tests implemented](https://github.com/Princeton-LSI-ResearchComputing/tracebase/blob/main/CONTRIBUTING.md#test-implementation) ``` Error: ``` .github/pull_request_template.md:29:81 MD013/line-length Line length [Expected: 80; Actual: 167] ```
kerem 2026-03-07 20:05:11 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Mar 24, 2021):

In its default configuration, MD013 does not report a violation if there are no spaces after the threshold. As explained in the documentation, this is to allow for things like long URLs (your second scenario). In the case of your first scenario, the extra text after the URL includes spaces and could be wrapped. There are other modes for this rule if you wish to be more or less strict: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013

<!-- gh-comment-id:805959727 --> @DavidAnson commented on GitHub (Mar 24, 2021): In its default configuration, MD013 does not report a violation if there are no spaces after the threshold. As explained in the documentation, this is to allow for things like long URLs (your second scenario). In the case of your first scenario, the extra text after the URL includes spaces and could be wrapped. There are other modes for this rule if you wish to be more or less strict: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013
Author
Owner

@hepcat72 commented on GitHub (Mar 24, 2021):

I see. Is there a rule to not include URL-related characters that are not rendered, in the count, such as [, ], and (*)?

<!-- gh-comment-id:805965501 --> @hepcat72 commented on GitHub (Mar 24, 2021): I see. Is there a rule to not include URL-related characters that are not rendered, in the count, such as `[`, `]`, and `(*)`?
Author
Owner

@DavidAnson commented on GitHub (Mar 24, 2021):

No, this rule is about how the Markdown file looks in the editor. Some people prefer not to have very long lines and this rule can help enforce that. If you are not worried about that part of the editing experience or use word wrap in your editor, it can be safely disabled without affecting the end-user experience.

<!-- gh-comment-id:806103897 --> @DavidAnson commented on GitHub (Mar 24, 2021): No, this rule is about how the Markdown file looks in the editor. Some people prefer not to have very long lines and this rule can help enforce that. If you are not worried about that part of the editing experience or use word wrap in your editor, it can be safely disabled without affecting the end-user experience.
Author
Owner

@hepcat72 commented on GitHub (Mar 24, 2021):

Ah. Yes, we are concerned with line length and generally have a project-wide 80 character limit. URLs in markdown though seem to be an exception, at least for us. I guess I misinterpreted the overall intent of this rule. Thanks for the explanation. It makes sense.

<!-- gh-comment-id:806114442 --> @hepcat72 commented on GitHub (Mar 24, 2021): Ah. Yes, we are concerned with line length and generally have a project-wide 80 character limit. URLs in markdown though seem to be an exception, at least for us. I guess I misinterpreted the overall intent of this rule. Thanks for the explanation. It makes sense.
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#2166
No description provided.