[GH-ISSUE #286] False positives from MD037 for bullet lists using asterisks #246

Closed
opened 2026-03-03 01:25:04 +03:00 by kerem · 17 comments
Owner

Originally created by @alexearnshaw on GitHub (May 5, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/286

Hi,

Since the weekend we have started getting false positives for rule MD037 when using the markdown-cli npm package in the CLI flow for our project.

For an example please see the results of running markdownlint-cli triggered as part of this PR on our project https://github.com/Axway/axway-open-docs/pull/696/checks?check_run_id=645259268

None of the files producing errors have been changed in this PR, so it seems like this check is suddenly failing as the linter is now not identifying the asterisks that are starting bullet list items correctly, and instead detecting them as emphasis markers?

Has there been a change recently that might have caused this?

Seems like it might be related to #280

Originally created by @alexearnshaw on GitHub (May 5, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/286 Hi, Since the weekend we have started getting false positives for rule MD037 when using the markdown-cli npm package in the CLI flow for our project. For an example please see the results of running markdownlint-cli triggered as part of this PR on our project https://github.com/Axway/axway-open-docs/pull/696/checks?check_run_id=645259268 None of the files producing errors have been changed in this PR, so it seems like this check is suddenly failing as the linter is now not identifying the asterisks that are starting bullet list items correctly, and instead detecting them as emphasis markers? Has there been a change recently that might have caused this? Seems like it might be related to #280
kerem closed this issue 2026-03-03 01:25:04 +03:00
Author
Owner

@alexearnshaw commented on GitHub (May 5, 2020):

Just to add a little more info - these false positives also suddenly appear using the VScode extension:

image

<!-- gh-comment-id:624008543 --> @alexearnshaw commented on GitHub (May 5, 2020): Just to add a little more info - these false positives also suddenly appear using the VScode extension: ![image](https://user-images.githubusercontent.com/29064556/81063058-116dbb80-8ecf-11ea-8483-4ff3970b939c.png)
Author
Owner

@XhmikosR commented on GitHub (May 5, 2020):

Came here to report a similar issue @DavidAnson.

This triggers MD037 while it shouldn't:

docs/main/coverage.md:9:73 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "_y8i8&t=100m26s) _"]
docs/main/coverage.md:16:93 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "_Zs4) _"]
docs/main/coverage.md:27:161 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "_pi/) _"]
- [Security Now Netcast: Pi-hole](https://www.youtube.com/watch?v=p7-osq_y8i8&t=100m26s) _Oct 13, 2015_
- [Linus Tech Tips: Block EVERY Online Ad with THIS](https://www.youtube.com/watch?v=KBXTnrD_Zs4) _Aug 28, 2019_
- [Adafruit: Pi-hole is a black hole for internet ads](https://blog.adafruit.com/2016/03/04/pi-hole-is-a-black-hole-for-internet-ads-piday-raspberrypi-raspberry_pi/) _Mar 4, 2016_

Seems a regression somewhere after markdownlint v0.19.0 since we are using markdownlint-cli 0.22.0 (markdownlint v0.19.0) and after updating to v0.20.0 we get the above.

<!-- gh-comment-id:624028290 --> @XhmikosR commented on GitHub (May 5, 2020): Came here to report a similar issue @DavidAnson. This triggers MD037 while it shouldn't: ``` docs/main/coverage.md:9:73 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "_y8i8&t=100m26s) _"] docs/main/coverage.md:16:93 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "_Zs4) _"] docs/main/coverage.md:27:161 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "_pi/) _"] ``` ```markdown - [Security Now Netcast: Pi-hole](https://www.youtube.com/watch?v=p7-osq_y8i8&t=100m26s) _Oct 13, 2015_ - [Linus Tech Tips: Block EVERY Online Ad with THIS](https://www.youtube.com/watch?v=KBXTnrD_Zs4) _Aug 28, 2019_ - [Adafruit: Pi-hole is a black hole for internet ads](https://blog.adafruit.com/2016/03/04/pi-hole-is-a-black-hole-for-internet-ads-piday-raspberrypi-raspberry_pi/) _Mar 4, 2016_ ``` Seems a regression somewhere after markdownlint v0.19.0 since we are using markdownlint-cli 0.22.0 (markdownlint v0.19.0) and after updating to v0.20.0 we get the above.
Author
Owner

@andreamussap commented on GitHub (May 5, 2020):

Hi. One more example - https://github.com/Axway/axway-open-docs/pull/672/checks?check_run_id=646024890

DavidAnsonIssue286

<!-- gh-comment-id:624032249 --> @andreamussap commented on GitHub (May 5, 2020): Hi. One more example - https://github.com/Axway/axway-open-docs/pull/672/checks?check_run_id=646024890 ![DavidAnsonIssue286](https://user-images.githubusercontent.com/10401080/81067224-3e719c80-8ed6-11ea-968b-fe1171e28693.jpg)
Author
Owner

@DavidAnson commented on GitHub (May 5, 2020):

Could folks please share specific examples? It’s not always possible to tell what’s going on from screenshots and test results.

@XhmikosR, I see your scenario, thanks. Here’s a minimal repro: https://dlaa.me/markdownlint/#%25m%23%20Issue%20286%0A%0A%5BLink%5D(under_score)%20followed%20by%20_underscore_%0A

<!-- gh-comment-id:624161089 --> @DavidAnson commented on GitHub (May 5, 2020): Could folks please share specific examples? It’s not always possible to tell what’s going on from screenshots and test results. @XhmikosR, I see your scenario, thanks. Here’s a minimal repro: https://dlaa.me/markdownlint/#%25m%23%20Issue%20286%0A%0A%5BLink%5D(under_score)%20followed%20by%20_underscore_%0A
Author
Owner

@DavidAnson commented on GitHub (May 5, 2020):

@alexearnshaw, your scenario seems fine in isolation, what am I missing? Link to the file?

https://dlaa.me/markdownlint/#%25m%23%20Issue%20286%0A%0A%3Alabel%0A%20%20*%20List%20item%0A%20%20*%20List%20item%0A%0A%3C!--%20markdownlint-disable-file%20ul-indent%20blanks-around-lists%20--%3E%0A

<!-- gh-comment-id:624164009 --> @DavidAnson commented on GitHub (May 5, 2020): @alexearnshaw, your scenario seems fine in isolation, what am I missing? Link to the file? https://dlaa.me/markdownlint/#%25m%23%20Issue%20286%0A%0A%3Alabel%0A%20%20*%20List%20item%0A%20%20*%20List%20item%0A%0A%3C!--%20markdownlint-disable-file%20ul-indent%20blanks-around-lists%20--%3E%0A
Author
Owner

@XhmikosR commented on GitHub (May 5, 2020):

@DavidAnson the repo is here https://github.com/pi-hole/docs

<!-- gh-comment-id:624166745 --> @XhmikosR commented on GitHub (May 5, 2020): @DavidAnson the repo is here https://github.com/pi-hole/docs
Author
Owner

@DavidAnson commented on GitHub (May 5, 2020):

@andreamussap, From what I see of your test output, you may be seeing the same list item behavior as above - though I don’t yet have a demo of that problem. Link to a problem file?

<!-- gh-comment-id:624167714 --> @DavidAnson commented on GitHub (May 5, 2020): @andreamussap, From what I see of your test output, you may be seeing the same list item behavior as above - though I don’t yet have a demo of that problem. Link to a problem file?
Author
Owner

@andreamussap commented on GitHub (May 5, 2020):

@andreamussap, From what I see of your test output, you may be seeing the same list item behavior as above - though I don’t yet have a demo of that problem. Link to a problem file?

@DavidAnson Alex and I work on the same project, so the issue is the same. If you go to this link https://github.com/Axway/axway-open-docs/pull/672/checks?check_run_id=646024890 you will see a red X before the Run markdown linter check.

Click to expand it and you'll see the MD037 errors, eg: content/en/docs/apigtw_devguide/jython_scripting.md:26:5 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "* Print a list of all referenc**..."]

The issue is that, suddenly, the markdownlinter thinks that the asterisks before the sentence is to make it bold/italic, but this is just to create an unordered list, as you can see here, on the page - https://axway-open-docs.netlify.app/docs/apigtw_devguide/jython_scripting/

These pages are there for ages, everything was working until last Friday (May 1st 2020)

<!-- gh-comment-id:624174153 --> @andreamussap commented on GitHub (May 5, 2020): > @andreamussap, From what I see of your test output, you may be seeing the same list item behavior as above - though I don’t yet have a demo of that problem. Link to a problem file? @DavidAnson Alex and I work on the same project, so the issue is the same. If you go to this link https://github.com/Axway/axway-open-docs/pull/672/checks?check_run_id=646024890 you will see a red X before the **Run markdown linter** check. Click to expand it and you'll see the MD037 errors, eg: content/en/docs/apigtw_devguide/jython_scripting.md:26:5 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "* Print a list of all referenc**..."] The issue is that, suddenly, the markdownlinter thinks that the asterisks before the sentence is to make it bold/italic, but this is just to create an unordered list, as you can see here, on the page - https://axway-open-docs.netlify.app/docs/apigtw_devguide/jython_scripting/ These pages are there for ages, everything was working until last Friday (May 1st 2020)
Author
Owner
<!-- gh-comment-id:624188584 --> @DavidAnson commented on GitHub (May 5, 2020): @andreamussap @alexearnshaw The content you have is not a valid list according to strict CommonMark parsing. Example below from that file. (What parser are you using and are you using any syntax extensions?) Also, I need to understand the difference between strict and non-strict mode. https://markdown-it.github.io/#md3=%7B%22source%22%3A%22%60analyze%60%5Cn%3A%20This%20category%20contains%20scripts%20to%3A%5Cn%20%20%20%20%2A%20Print%20a%20list%20of%20all%20references%20in%20the%20API%20Gateway.%20For%20each%20reference%20it%20shows%20what%20store%20it%20originates%20from%20and%20to.%5Cn%20%20%20%20%2A%20Check%20if%20the%20API%20Gateway%20is%20locked%20down.%5Cn%20%20%20%20%2A%20Get%20a%20list%20of%20unresolved%20references%20between%20entities%20in%20the%20API%20Gateway.%5Cn%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Atrue%2C%22_view%22%3A%22html%22%7D%7D
Author
Owner

@andreamussap commented on GitHub (May 5, 2020):

@DavidAnson since you asked for a demo I've recorded this video - not even sure if you still need it

https://www.loom.com/share/ca68c88dce1e40359a8e1ca1ac092f18

on the strict and non-strict mode I don't know this answer. Will have to wait for @alexearnshaw

<!-- gh-comment-id:624198413 --> @andreamussap commented on GitHub (May 5, 2020): @DavidAnson since you asked for a demo I've recorded this video - not even sure if you still need it https://www.loom.com/share/ca68c88dce1e40359a8e1ca1ac092f18 on the strict and non-strict mode I don't know this answer. Will have to wait for @alexearnshaw
Author
Owner

@alexearnshaw commented on GitHub (May 5, 2020):

@DavidAnson we are using Hugo with Blackfriday parser. Our project is https://github.com/Axway/axway-open-docs

Looking into this a bit more, it does seem that most of these new errors that appeared today for MD037 are to do with asterisks being used for list items within a definition list, so perhaps our Markdown is wrong...and maybe this isn't a markdownlint issue after all. I'm not sure if unordered list items within a definition list are valid, so maybe we just need to change our files...

However I'm still wondering why we didn't get these errors with the same files/same content last week - has anything changed in markdownlint (that would affect both markdownlint-cli and vscode extension) that would make these rule violations suddenly appear now, when they didn't before?

<!-- gh-comment-id:624234176 --> @alexearnshaw commented on GitHub (May 5, 2020): @DavidAnson we are using Hugo with Blackfriday parser. Our project is https://github.com/Axway/axway-open-docs Looking into this a bit more, it does seem that most of these new errors that appeared today for MD037 are to do with asterisks being used for list items within a definition list, so perhaps our Markdown is wrong...and maybe this isn't a markdownlint issue after all. I'm not sure if unordered list items within a definition list are valid, so maybe we just need to change our files... However I'm still wondering why we didn't get these errors with the same files/same content last week - has anything changed in markdownlint (that would affect both markdownlint-cli and vscode extension) that would make these rule violations suddenly appear now, when they didn't before?
Author
Owner

@DavidAnson commented on GitHub (May 5, 2020):

@alexearnshaw This is almost certainly due to a change I made to re-implement that rule in the recent release. Per comments in a separate issue, it looks like this project directly installs the CLI as part of its CI Action which helps explain the timeline: https://github.com/Axway/axway-open-docs/pull/696#issuecomment-624269827

The problematic syntax here appears valid for your toolset, so I’m not prepared to say that it is “wrong“. :) That said, the link I provided demonstrates that it is not valid CommonMark in strict mode. I need to do some research to understand why it is valid in non-strict mode. I don’t know yet whether I can switch the linter to non-strict mode.

One thing you may be able to do is add a blank line between the list and the previous label. I’m not sure if that has the same meaning in Hugo/Blackfriday, but would almost definitely address the issue with the linter.

<!-- gh-comment-id:624274467 --> @DavidAnson commented on GitHub (May 5, 2020): @alexearnshaw This is almost certainly due to a change I made to re-implement that rule in the recent release. Per comments in a separate issue, it looks like this project directly installs the CLI as part of its CI Action which helps explain the timeline: https://github.com/Axway/axway-open-docs/pull/696#issuecomment-624269827 The problematic syntax here appears valid for your toolset, so I’m not prepared to say that it is “wrong“. :) That said, the link I provided demonstrates that it is not valid CommonMark in strict mode. I need to do some research to understand why it is valid in non-strict mode. I don’t know yet whether I can switch the linter to non-strict mode. One thing you may be able to do is add a blank line between the list and the previous label. I’m not sure if that has the same meaning in Hugo/Blackfriday, but would almost definitely address the issue with the linter.
Author
Owner

@DavidAnson commented on GitHub (May 6, 2020):

@alexearnshaw, an update:

The problematic structure is called a definition list. Here's the syntax and corresponding HTML: https://www.markdownguide.org/extended-syntax/#definition-lists

This is not natively part of the CommonMark spec which is why it is not recognized (i.e., "strict mode") by the underlying parser or markdownlint.

There is a plug-in to add support for this to the parser and plugins are supported by markdownlint, but sadly not by the CLI: https://github.com/markdown-it/markdown-it-deflist

That said, I don't think the use of definition lists by this project is correct; the relevant items are not terms or descriptions: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl

Rather, they appear to me to be lists, so I would suggest converting the project to use standard Markdown lists which should not trigger the problematic warnings.

Note that definition lists aren't rendered properly by GitHub, either, which is why the "analyze", etc. sections here look like paragraphs instead of lists: https://github.com/Axway/axway-open-docs/blob/master/content/en/docs/apigtw_devguide/jython_scripting.md

As such, I do not currently think this is a bug in markdownlint. Please let me know what you think.

<!-- gh-comment-id:624454213 --> @DavidAnson commented on GitHub (May 6, 2020): @alexearnshaw, an update: The problematic structure is called a definition list. Here's the syntax and corresponding HTML: https://www.markdownguide.org/extended-syntax/#definition-lists This is not natively part of the CommonMark spec which is why it is not recognized (i.e., "strict mode") by the underlying parser or `markdownlint`. There is a plug-in to add support for this to the parser and plugins are supported by `markdownlint`, but sadly not by the CLI: https://github.com/markdown-it/markdown-it-deflist That said, I don't think the use of definition lists by this project is correct; the relevant items are not terms or descriptions: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl Rather, they appear to me to be lists, so I would suggest converting the project to use standard Markdown lists which should not trigger the problematic warnings. Note that definition lists aren't rendered properly by GitHub, either, which is why the "analyze", etc. sections here look like paragraphs instead of lists: https://github.com/Axway/axway-open-docs/blob/master/content/en/docs/apigtw_devguide/jython_scripting.md As such, I do not currently think this is a bug in `markdownlint`. Please let me know what you think.
Author
Owner

@alexearnshaw commented on GitHub (May 6, 2020):

@DavidAnson I agree this is not a bug in markdownlint. Thanks a lot for your help and advice!

<!-- gh-comment-id:624578256 --> @alexearnshaw commented on GitHub (May 6, 2020): @DavidAnson I agree this is not a bug in markdownlint. Thanks a lot for your help and advice!
Author
Owner

@DavidAnson commented on GitHub (May 7, 2020):

Great, thanks for working through this! I'm going to close this issue as we no longer think bullet lists are a problem. I'm tracking the other MD037 issues separately and will fix them soon.

<!-- gh-comment-id:625021879 --> @DavidAnson commented on GitHub (May 7, 2020): Great, thanks for working through this! I'm going to close this issue as we no longer think bullet lists are a problem. I'm tracking the other MD037 issues separately and will fix them soon.
Author
Owner

@DavidAnson commented on GitHub (May 8, 2020):

@XhmikosR, your scenario is fixed in the next release by github.com/DavidAnson/markdownlint@37f1d6b64b. The Pi-Hole repository is protected from surprise regressions by https://github.com/DavidAnson/markdownlint/actions?query=workflow%3ATestRepos.

<!-- gh-comment-id:626056341 --> @DavidAnson commented on GitHub (May 8, 2020): @XhmikosR, your scenario is fixed in the next release by https://github.com/DavidAnson/markdownlint/commit/37f1d6b64bd6f06437107fd4edef660c2f54ee9f. The Pi-Hole repository is protected from surprise regressions by https://github.com/DavidAnson/markdownlint/actions?query=workflow%3ATestRepos.
Author
Owner

@XhmikosR commented on GitHub (May 9, 2020):

@DavidAnson Thanks! Just keep in mind that it's using some non-standard syntax in a few places.

<!-- gh-comment-id:626111334 --> @XhmikosR commented on GitHub (May 9, 2020): @DavidAnson Thanks! Just keep in mind that it's using some non-standard syntax in a few places.
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#246
No description provided.