[GH-ISSUE #736] MD035 is triggered by horizontal line in list #528

Closed
opened 2026-03-03 01:27:42 +03:00 by kerem · 8 comments
Owner

Originally created by @NomarCub on GitHub (Mar 5, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/736

hr-style triggers for consistent styles that are inside a list. Here's an example of valid markdown:

- a
  - b
  - ---
  - c
- d
- ---
- e
Originally created by @NomarCub on GitHub (Mar 5, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/736 `hr-style` triggers for consistent styles that are inside a list. Here's an [example](https://spec.commonmark.org/dingus/?text=-%20a%0A%20%20-%20b%0A%20%20-%20---%0A%20%20-%20c%0A-%20d%0A-%20---%0A-%20e) of valid markdown: ```md - a - b - --- - c - d - --- - e ```
kerem 2026-03-03 01:27:42 +03:00
Author
Owner

@nschonni commented on GitHub (Mar 5, 2023):

You'll notice that the HRs actually breakup the list and aren't treated as part of the list

- a
  - b
---
  - c
- d
---
- e
<!-- gh-comment-id:1455038889 --> @nschonni commented on GitHub (Mar 5, 2023): You'll notice that the HRs actually breakup the list and aren't treated as part of the list ``` - a - b --- - c - d --- - e ```
Author
Owner

@DavidAnson commented on GitHub (Mar 5, 2023):

The sample as presented does not produce MD035 warnings for me. However, adding another horizontal rule to the top of the sample with the same style does produce a warning which I agree is inappropriate: https://dlaa.me/markdownlint/#%25m%23%20Issue%20736%0A%0A---%0A%0A-%20a%0A%20%20-%20b%0A%20%20-%20---%0A%20%20-%20c%0A-%20d%0A-%20---%0A-%20e%0A

<!-- gh-comment-id:1455163740 --> @DavidAnson commented on GitHub (Mar 5, 2023): The sample as presented does not produce MD035 warnings for me. However, adding another horizontal rule to the top of the sample with the same style **does** produce a warning which I agree is inappropriate: https://dlaa.me/markdownlint/#%25m%23%20Issue%20736%0A%0A---%0A%0A-%20a%0A%20%20-%20b%0A%20%20-%20---%0A%20%20-%20c%0A-%20d%0A-%20---%0A-%20e%0A
Author
Owner

@NomarCub commented on GitHub (Mar 5, 2023):

I've sat on this a little, and I can see now that the markdown based app I use (Obsidian) also processes - --- as an hr, not a list item. It just looked the way I thought it should. So my original point is moot.

Is the conclusion that the rule should produce a warning both for my text and yours? Or for neither? @DavidAnson

<!-- gh-comment-id:1455193345 --> @NomarCub commented on GitHub (Mar 5, 2023): I've sat on this a little, and I can see now that the markdown based app I use (Obsidian) also processes `- ---` as an hr, not a list item. It just looked the way I thought it should. So my original point is moot. Is the conclusion that the rule should produce a warning both for my text and yours? Or for neither? @DavidAnson
Author
Owner

@DavidAnson commented on GitHub (Mar 5, 2023):

It sounds like your original issue may have been a misunderstanding, but I think there is a legitimate problem revealed by the sample i link to above. I will try to fix that problem. I can either use this issue as a reminder or you can close it if you'd like and I will leave myself a note on my private TODO list.

<!-- gh-comment-id:1455211905 --> @DavidAnson commented on GitHub (Mar 5, 2023): It sounds like your original issue may have been a misunderstanding, but I think there is a legitimate problem revealed by the sample i link to above. I will try to fix that problem. I can either use this issue as a reminder or you can close it if you'd like and I will leave myself a note on my private TODO list.
Author
Owner

@NomarCub commented on GitHub (Mar 5, 2023):

Sure, I get the sequence of events, and I'll leave this open. You might want to rename it to reflect the actual problem for others stumbling onto it in the meantime.

And my last question still stands. I had my example text and you posted yours. Should the rule should produce a warning both for my text and yours, or for neither?

<!-- gh-comment-id:1455213344 --> @NomarCub commented on GitHub (Mar 5, 2023): Sure, I get the sequence of events, and I'll leave this open. You might want to rename it to reflect the actual problem for others stumbling onto it in the meantime. And my last question still stands. I had my example text and you posted yours. Should the rule should produce a warning *both* for my text and yours, or for *neither*?
Author
Owner

@DavidAnson commented on GitHub (Mar 5, 2023):

The horizontal rule style in your original sample is consistent, so there should be no warnings for that – and there are not. The style is also consistent in the modified version I link to so there should not be warnings there – but there are. That is the bug and once I fix it, neither example will produce a warning about inconsistent horizontal rule style.

<!-- gh-comment-id:1455229812 --> @DavidAnson commented on GitHub (Mar 5, 2023): The horizontal rule style in your original sample is consistent, so there should be no warnings for that – and there are not. The style is also consistent in the modified version I link to so there should not be warnings there – but there are. That is the bug and once I fix it, neither example will produce a warning about inconsistent horizontal rule style.
Author
Owner

@NomarCub commented on GitHub (Mar 6, 2023):

That's what I wanted originally too. But now I see that - --- gets interpreted as --- by CommonMark, so it really does seem like an inconsistent hr. What's the rationale behind not giving a warning?

<!-- gh-comment-id:1455706830 --> @NomarCub commented on GitHub (Mar 6, 2023): That's what I wanted originally too. But now I see that `- ---` gets interpreted as `---` by CommonMark, so it really does seem like an inconsistent hr. What's the rationale behind not giving a warning?
Author
Owner

@DavidAnson commented on GitHub (Mar 6, 2023):

Every HR in your example uses the same "---" style, so there should be no warning of inconsistency. If one of them used the "***" style, I would expect a warning for the mixed use.

<!-- gh-comment-id:1456523550 --> @DavidAnson commented on GitHub (Mar 6, 2023): Every HR in your example uses the same "---" style, so there should be no warning of inconsistency. If one of them used the "***" style, I would expect a warning for the mixed use.
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#528
No description provided.