question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comments in Lists

See original GitHub issue

MD032 is being flagged when HTML comments are included between list items. General example is

- item <!-- comment -->
- item <!-- comment -->
<!--
  - commented subitem: description
  - commented subitem: description
-->
- item <!-- comment -->
- item <!-- comment -->

Markdown lint is complaining that lines 2 and 7 are MD032 violations because there aren’t spaces around them, but if spaces are added (between 2 & 3 and 6 & 7) then that separates the sublist from the list and, when uncommented, leads to MD012 being flagged.

Alternatively, the comment can be adjusted so that it looks like

- item <!-- comment -->
- item <!-- comment -->
<!--- commented subitem: description
    - commented subitem: description-->
- item <!-- comment -->
- item <!-- comment -->

but (as well as looking weird) that flags a MD007 error when the sublist is uncommented.

From what I can tell there isn’t a way to structure comments in lists without breaking one of those three rules. The ideal fix (I think) would be for MD032 to not fail in cases where the non-empty line next to the list is a comment, as a bonus going on to check if the line the other side of the comment is a list item or a blank line.

The context for this issue was this GitHub issue template which has a commented sublist and so seemingly can never be markdownlint compliant.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
DavidAnsoncommented, Dec 20, 2021

When I looked at the code, I decided the tool’s definition of “blank line” should have treated all your examples as scenarios that did NOT generate MD032. The next release of the library should behave as you expected. Here’s the new test case: https://raw.githubusercontent.com/DavidAnson/markdownlint/6dea67825aac29bc6e43bd932d641e2bfe7b38ff/test/lists-with-commented-items.md

0reactions
Foggalongcommented, Sep 23, 2021

Haha, seems I’ve found a bug but not the bug I thought I’d found!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add and reply to comments in list items - Microsoft Support
Select the list item, and then select Comment. ... Or select the icon next to the list item. In the Comments pane, type...
Read more >
How to manage comments on a Microsoft list
Hover over the list item and click on the Comment Icon or check the box next to the item and choose Comment from...
Read more >
How to add Comments to SharePoint Online List Items and ...
View SharePoint Online List Item Comments ... We can easily view comments for each list item. But you can not add it directly...
Read more >
How to share and comment in the new Microsoft Lists - YouTube
If you want to share a list with other people then this is all possible. You can also share individual list items in...
Read more >
SharePoint Online: All you need to know about Commenting ...
Users can see which list items have comments when they access the SharePoint Online list view or Microsoft list home page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found