[GH-ISSUE #47] MD030, Spaces after list markers isn’t enforced if 0 spaces #38

Open
opened 2026-03-03 01:23:13 +03:00 by kerem · 10 comments
Owner

Originally created by @thomasjbradley on GitHub (Feb 17, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/47

Here’s an example of incorrect Markdown:

-Some stuff
-More stuff
- Things

I would like to enforce a single space after those dashes in the list. Without the space Markdown interprets it as a paragraph.

Important configuration I have turned on:

{
  "ul-style": {
    "style": "dash"
  },
  "list-indent": true,
  "ul-start-left": true,
  "ul-indent": {
    "indent": 2
  },
  "list-marker-space": {
    "ul_single": 1,
    "ol_single": 1,
    "ul_multi": 1,
    "ol_multi": 1
  },
}

What error message I do see:

MD032 — Lists should be surrounded by blank lines.

Which doesn’t make sense to me because those aren’t separate lists. It’s interpreting the last, correct dash, as a list and the other two as paragraphs.

Use case:

I teach beginners, people who have never written a line of Markdown before. The idea that a missing space can have such an impact is foreign. I’d like to use the linter to find these simple mistakes beforehand.

Any thoughts would be appreciated. Thanks.

Originally created by @thomasjbradley on GitHub (Feb 17, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/47 **Here’s an example of incorrect Markdown:** ```md -Some stuff -More stuff - Things ``` *I would like to enforce a single space after those dashes in the list. Without the space Markdown interprets it as a paragraph.* **Important configuration I have turned on:** ```json { "ul-style": { "style": "dash" }, "list-indent": true, "ul-start-left": true, "ul-indent": { "indent": 2 }, "list-marker-space": { "ul_single": 1, "ol_single": 1, "ul_multi": 1, "ol_multi": 1 }, } ``` **What error message I do see:** `MD032 — Lists should be surrounded by blank lines.` Which doesn’t make sense to me because those aren’t separate lists. It’s interpreting the last, correct dash, as a list and the other two as paragraphs. **Use case:** I teach beginners, people who have never written a line of Markdown before. The idea that a missing space can have such an impact is foreign. I’d like to use the linter to find these simple mistakes beforehand. Any thoughts would be appreciated. Thanks.
Author
Owner

@DavidAnson commented on GitHub (Feb 17, 2017):

The specification is clear about the need for spaces after list markers: http://spec.commonmark.org/0.27/#list-items

So the output you're getting is technically correct. That said, I agree it's not the most helpful for this scenario. I'll think about how to modify the rule to make things more clear. Thank you!

<!-- gh-comment-id:280557944 --> @DavidAnson commented on GitHub (Feb 17, 2017): The specification is clear about the need for spaces after list markers: http://spec.commonmark.org/0.27/#list-items So the output you're getting is *technically* correct. That said, I agree it's not the most helpful for this scenario. I'll think about how to modify the rule to make things more clear. Thank you!
Author
Owner

@thomasjbradley commented on GitHub (Feb 17, 2017):

Thanks for your response.

I just read the spec—and yes it does definitely require as space as you say.
And yeah, you’re right that the error message is “technically” correct—but not terribly helpful.

Though it’s explained to my students that a space is required after a list marker only about half actually add it. It’d be great to come up with a helpful solution.

Just some thoughts here:

  • What’s the benefit of allowing paragraphs to start a line with a dash when the dash is specifically defined as the only list marker? I can’t think of any reason when I would start a paragraph with a dash in Markdown and not expect it to become a list.
  • Maybe I should add a custom post linter to my own code that somehow enforces spaces after dashes.

Thanks for your help.

<!-- gh-comment-id:280670589 --> @thomasjbradley commented on GitHub (Feb 17, 2017): Thanks for your response. I just read the spec—and yes it does definitely require as space as you say. And yeah, you’re right that the error message is “technically” correct—but not terribly helpful. Though it’s explained to my students that a space is required after a list marker only about half actually add it. It’d be great to come up with a helpful solution. Just some thoughts here: - What’s the benefit of allowing paragraphs to start a line with a dash when the dash is specifically defined as the only list marker? I can’t think of any reason when I would start a paragraph with a dash in Markdown and not expect it to become a list. - Maybe I should add a custom post linter to my own code that somehow enforces spaces after dashes. Thanks for your help.
Author
Owner

@DavidAnson commented on GitHub (Feb 17, 2017):

I think I can do something useful here. :) Let me finish working on a different issue then I will look into this some more.

<!-- gh-comment-id:280691597 --> @DavidAnson commented on GitHub (Feb 17, 2017): I think I can do something useful here. :) Let me finish working on a different issue then I will look into this some more.
Author
Owner

@thomasjbradley commented on GitHub (Feb 17, 2017):

Awesome, thanks.

<!-- gh-comment-id:280692246 --> @thomasjbradley commented on GitHub (Feb 17, 2017): Awesome, thanks.
Author
Owner

@DavidAnson commented on GitHub (Feb 18, 2017):

When people make this mistake, do they tend to forget just some of the spaces or all of them?

<!-- gh-comment-id:280815896 --> @DavidAnson commented on GitHub (Feb 18, 2017): When people make this mistake, do they tend to forget just some of the spaces or all of them?
Author
Owner

@thomasjbradley commented on GitHub (Feb 18, 2017):

It’s almost always all of the spaces.

<!-- gh-comment-id:280851174 --> @thomasjbradley commented on GitHub (Feb 18, 2017): It’s almost always all of the spaces.
Author
Owner

@DavidAnson commented on GitHub (Feb 21, 2017):

This seems like it will be more of a heuristic than an absolute - I'm going to make it a new rule so it can be disabled independently of MD030. I have an implementation in mind, but it may not make the cut for the upcoming release.

<!-- gh-comment-id:281218042 --> @DavidAnson commented on GitHub (Feb 21, 2017): This seems like it will be more of a heuristic than an absolute - I'm going to make it a new rule so it can be disabled independently of `MD030`. I have an implementation in mind, but it may not make the cut for the upcoming release.
Author
Owner

@thomasjbradley commented on GitHub (Feb 21, 2017):

Okay—thanks so much for looking into it.

<!-- gh-comment-id:281475497 --> @thomasjbradley commented on GitHub (Feb 21, 2017): Okay—thanks so much for looking into it.
Author
Owner

@chrisdebian commented on GitHub (Nov 3, 2025):

Hi, all. This issue's getting quite old now, I wonder if it got resolved in later releases?

Chris

<!-- gh-comment-id:3482056152 --> @chrisdebian commented on GitHub (Nov 3, 2025): Hi, all. This issue's getting quite old now, I wonder if it got resolved in later releases? Chris
Author
Owner

@DavidAnson commented on GitHub (Nov 3, 2025):

You can see how the latest version behaves below. This behavior has not changed.

https://dlaa.me/markdownlint/#%25m%23%20Issue%2047%0A%0A-Some%20stuff%0A-More%20stuff%0A-%20Things%0A

<!-- gh-comment-id:3482579083 --> @DavidAnson commented on GitHub (Nov 3, 2025): You can see how the latest version behaves below. This behavior has not changed. https://dlaa.me/markdownlint/#%25m%23%20Issue%2047%0A%0A-Some%20stuff%0A-More%20stuff%0A-%20Things%0A
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#38
No description provided.