[GH-ISSUE #202] MD046 flagged when html comment in list item as string #172

Closed
opened 2026-03-03 01:24:23 +03:00 by kerem · 2 comments
Owner

Originally created by @nschonni on GitHub (Jul 5, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/202

OK, I can't seem to get a minimum reproduction, but I hit it in this file github.com/MicrosoftDocs/visualstudio-docs@3375c14411/docs/xml-tools/walkthrough-using-xml-editor-features.md
The following section and the final H2 get flagged with the rule

2. Select **<!--** to add a comment node and press **Enter**.

     The editor inserts a comment end tag and places the cursor between the start and end comment tags.

This doesn't reproduce on your demo site with just the snippet, so I think there is a larger edge case I'm not seeing.
I can resolve it if I change <!-- to &lt;--, so it is probably somewhere in the HTML comment handling

Originally created by @nschonni on GitHub (Jul 5, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/202 OK, I can't seem to get a minimum reproduction, but I hit it in this file https://github.com/MicrosoftDocs/visualstudio-docs/blob/3375c14411efb46b62c594fa5d504be9a0fcd5f8/docs/xml-tools/walkthrough-using-xml-editor-features.md The following section and the final H2 get flagged with the rule ```md 2. Select **<!--** to add a comment node and press **Enter**. The editor inserts a comment end tag and places the cursor between the start and end comment tags. ``` This doesn't reproduce on your demo site with just the snippet, so I think there is a larger edge case I'm not seeing. I can resolve it if I change `<!--` to `&lt;--`, so it is probably somewhere in the HTML comment handling
kerem 2026-03-03 01:24:23 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jul 5, 2019):

Thanks for trying! I’ll have a look in a couple of weeks when I circle back to this project.

<!-- gh-comment-id:508858533 --> @DavidAnson commented on GitHub (Jul 5, 2019): Thanks for trying! I’ll have a look in a couple of weeks when I circle back to this project.
Author
Owner

@DavidAnson commented on GitHub (Jul 29, 2019):

I’m not able to reproduce this so far. That start-comment marker is recognized as beginning a comment, so the content after gets ignored. This is intentional and consistent with HTML. Given the uniqueness of this scenario and the workaround you propose, I’m not sure it’s worth spending too much more time here.

<!-- gh-comment-id:515850304 --> @DavidAnson commented on GitHub (Jul 29, 2019): I’m not able to reproduce this so far. That start-comment marker is recognized as beginning a comment, so the content after gets ignored. This is intentional and consistent with HTML. Given the uniqueness of this scenario and the workaround you propose, I’m not sure it’s worth spending too much more time here.
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#172
No description provided.