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

@kdeldycke kdeldycke commented Jul 2, 2020

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:

kdeldycke added a commit to kdeldycke/awesome-iam that referenced this issue Jul 10, 2020
kdeldycke added a commit to kdeldycke/awesome-iam that referenced this issue Jul 10, 2020
@DavidAnson
Copy link
Owner

@DavidAnson DavidAnson commented Jul 21, 2020

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

@DavidAnson DavidAnson closed this Jul 21, 2020
@kdeldycke
Copy link
Author

@kdeldycke kdeldycke commented Jul 26, 2020

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.