Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MD013] Allow trailing dashes in long list items #302

Closed
kdeldycke opened this issue Jul 2, 2020 · 4 comments
Closed

[MD013] Allow trailing dashes in long list items #302

kdeldycke opened this issue Jul 2, 2020 · 4 comments
Labels

Comments

@kdeldycke
Copy link

Here is Markdown list of very long items:

❯ cat ./dash-separated-link-list.md
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the list. That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on incredible stuff we're not used to see everyday](#link-3) - Line #3's description.
- [Link number three](#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website) - Fourth description.

It properly renders into 4 items:

But it does not comply with the MD013 rule:

❯ markdownlint ./dash-separated-link-list.md
(...)
./dash-separated-link-list.md:2:81 MD013/line-length Line length [Expected: 80; Actual: 128]
./dash-separated-link-list.md:3:81 MD013/line-length Line length [Expected: 80; Actual: 146]
./dash-separated-link-list.md:4:81 MD013/line-length Line length [Expected: 80; Actual: 119]

Now I'd like to limit each line to 80 characters. My cleaned-up markdown now looks like:

❯ cat ./dash-separated-link-list-80-chars.md
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the list.
  That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on incredible
  stuff we're not used to see everyday](#link-3) - Line \#3's description.
- [Link number
  three](#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website) -
  Fourth description.

But this makes markdownlint unhappy:

❯ markdownlint ./dash-separated-link-list-80-chars.md
(...)
./dash-separated-link-list-80-chars.md:7:81 MD013/line-length Line length [Expected: 80; Actual: 86]

The thing is I can't simply split the 4th item before the middle dash. The layout below:

- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the list.
  That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on incredible
  stuff we're not used to see everyday](#link-3) - Line \#3's description.
- [Link number
  three](#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website)
  - Fourth description.

rightfully renders the last description into its own sub-list:

This is an edge-case, and I'd like to have markdownlint detect and allow for trailing spaces and dashes in long lines.


For reference, here the version I'm using:

❯ markdownlint --version
0.23.2

For the record, this edge-case is currently being discussed at:

@DavidAnson
Copy link
Owner

I will close this issue because it seems link references are working well.

@kdeldycke
Copy link
Author

OK to close that one. And thanks @DavidAnson for the tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants