mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 17:56:02 +03:00
[GH-ISSUE #498] MD035: Horizontal Rule enforcement broken #406
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#406
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 @TheJaredWilcurt on GitHub (Feb 6, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/498
Dependency versions:
0.31.10.25.112.3.2Rule
Description
Previously (0.24.0) using
- - -would throw this error:[Expected: * * *; Actual: - - -]Now it throws:
[Expected: * * *; Actual: ---]Same with
* * * *[Expected: * * *; Actual: * * * *][Expected: * * *; Actual: ****]Reproduction
@TheJaredWilcurt commented on GitHub (Feb 6, 2022):
The above would just be confusing for people, but there is also a functionality bug:
If you set your rule's style to this:
It will take a valid use like
* * *and report it as an error, because it is removing the spaces@DavidAnson commented on GitHub (Feb 6, 2022):
Ugh, I "improved" this rule by relying more on the parser to identify syntax, but it seems to be normalizing and that leads to this problem.
@DavidAnson commented on GitHub (Feb 10, 2022):
The
markdown-itparser represents thematic breaks as symbol and count, ignoring spaces as allowed by the CommonMark specification. My recent change to use the parser representation fixed an issue handling thematic breaks in a blockquote and I'd rather not go back to parsing the line manually. I'm tempted to make a change to the rule to ignores spaces so the problem you report will be addressed. However, the rule would then not care about spaces and would allow three asterisks together and three asterisks with a single space in the same document, for example. The rule would become less picky than it is today, so would not start flagging anything that isn't already a violation. However, it would not allow being specific about the number of spaces like it previously did. I think I'm fine with that, but am open to feedback.@TheJaredWilcurt commented on GitHub (Feb 13, 2022):
I don't see that as any different to this problem. You're just shifting it from a detection problem, to an enforcement problem. A linter should allow you to enforce stylistic choices. I shouldn't have to manually change someone else's PR to convert all the
***to* * *to match the rest of the code and maintain consistency, the linter should be able to handle that.Also in some Markdown interpreters (like Haroopad), Different ways of writing an
<hr>result in different classes being applied in the output to give greater choice in how impactful the HR is visually. This doesn't impact me, but may be relevant to others.The more I learn about
markdown-itthe more I do not like it.@DavidAnson commented on GitHub (Feb 13, 2022):
Fair points. I have an idea how to be picky in the current context and will explore that when I get to this issue. It sounds like you want the freedom to define a break as "* * *" and have that exclusively enforced.
Unrelated, I don't think it's fair to blame
markdown-itfor any problems related to this project. I'm (ab)using it for a purpose it wasn't intended to support. :)@TheJaredWilcurt commented on GitHub (Feb 25, 2022):
Yes, I want to continue enforcing that, it is currently the last of my breaking tests preventing me from updating my markdownlint ruleset from 0.16.0 to latest (0.25.X).
I'm excited to get that fixed/merged/released, as there are new rules that have been added to markdownlint that I had been waiting for.
typekeyword #861typekeyword #2709