mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #1560] New rule to warn about (unordered) list items missing space between the list item marker and the text #2556
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#2556
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 @dreambe on GitHub (Apr 7, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1560
unsupport those *,-,+ ,**,#, behind should have a withespace
@DavidAnson commented on GitHub (Apr 7, 2025):
Please provide more context, say which rule(s) this references, and provide an example of the behavior you think is incorrect. Your current issue title is not enough to go on.
@dreambe commented on GitHub (Apr 7, 2025):
another question ,中文符号的问题。this just because Chinese brackets: ()
标题
example 1
**(你好朋友)**哈哈哈哈哈
example 2
(你好朋友) 哈哈哈哈哈
@dreambe commented on GitHub (Apr 7, 2025):
标题
example 1
-hello
example 2
@DavidAnson commented on GitHub (Apr 7, 2025):
I still don't understand what issue you are reporting. The above are examples of Markdown and I don't see anything having to do with markdownlint. For example, spaces are required after a list item marker per the specification: https://spec.commonmark.org/0.31.2/#list-items. But the last example above seems to suggest no space should be required?
@dreambe commented on GitHub (Apr 8, 2025):
Sorry about poor English
The examples above demonstrate that when using Markdown formatting, if the last character inside a bold (**) block is a Chinese punctuation mark, the rendering is incorrect — unless a space is added after the closing **, in which case it displays properly.
The second example shows that in English, an unordered list item written as -hello is rendered exactly as -hello, and only when a space is added after the hyphen (i.e., - hello) does it become a proper list item.
Additionally, these issues are not flagged by markdownlint, even though they can lead to rendering errors or unexpected results.
@DavidAnson commented on GitHub (Apr 9, 2025):
Thank you, I understand now! I think you're pointing out two Markdown behaviors that could have new rules added to
markdownlintto detect and warn about them.The first example behaves the same in English and Chinese with and without parenthesis. Embedded emphasis is rare, especially with parenthesis, so I do not think this is worth adding a new rule for.
The second example happens in English and I agree it's a mistake people could make and a new rule could help with that.
Demonstration of CommonMark behavior:
https://dlaa.me/markdownlint/#%25m%23%20Issue%201560%0A%0A---%0A%0AEnglish%20parens%20ignore%20embedded%20emphasis%3A%0A%0A**(text)text%0A%0A(text)%20text%0A%0AChinese%20behaves%20the%20same%3A%0A%0A%EF%BC%88%E4%BD%A0%E5%A5%BD%E6%9C%8B%E5%8F%8B%EF%BC%89**%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88%0A%0A**%EF%BC%88%E4%BD%A0%E5%A5%BD%E6%9C%8B%E5%8F%8B%EF%BC%89**%20%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88%0A%0AEnglish%20without%20parens%20applies%20embedded%20emphasis%3A%0A%0Atexttext%0A%0AChinese%20behaves%20the%20same%3A%0A%0A**%E4%BD%A0%E5%A5%BD%E6%9C%8B%E5%8F%8B**%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88%0A%0A---%0A%0AForgetting%20to%20put%20a%20space%20after%20a%20list%20item%20marker%20does%20not%20create%20a%20list%20item%20(the%20space%20is%20required%20by%20the%20CommonMark%20specification)%3A%0A%0A-not%20a%20list%20item%0A%0A-%20list%20item%0A
@dreambe commented on GitHub (Apr 14, 2025):
strongly sugesst add a new rule the first example