[GH-ISSUE #533] MD037: false positive for nested asterisks within an emphasized word #433

Closed
opened 2026-03-03 01:26:53 +03:00 by kerem · 7 comments
Owner

Originally created by @wvanderp on GitHub (Jun 21, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/533

markdownlint marks the following markdown as having an error:

**co****ha**bitation **pro**ject

image

I don't have any ideas for a fix but I am available for more questions.
and I might be able to look into it some day

Originally created by @wvanderp on GitHub (Jun 21, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/533 markdownlint marks the following markdown as having an error: `**co****ha**bitation **pro**ject` ![image](https://user-images.githubusercontent.com/2423856/174808807-a2fc0a76-0c09-48b7-a070-3c0d6a70578f.png) I don't have any ideas for a fix but I am available for more questions. and I might be able to look into it some day
kerem 2026-03-03 01:26:53 +03:00
Author
Owner

@DavidAnson commented on GitHub (Jun 21, 2022):

Is this a real example? I think it could be written more simply in a way that would not trigger this violation.

<!-- gh-comment-id:1161938577 --> @DavidAnson commented on GitHub (Jun 21, 2022): Is this a real example? I think it could be written more simply in a way that would not trigger this violation.
Author
Owner

@DavidAnson commented on GitHub (Jun 21, 2022):

My idea to use "_" didn't work, but here is something that is a little more clear about what it's trying to do and doesn't produce a violation: **co\*\*\*\*ha**bitation **pro**ject

<!-- gh-comment-id:1161952646 --> @DavidAnson commented on GitHub (Jun 21, 2022): My idea to use "_" didn't work, but here is something that is a little more clear about what it's trying to do and doesn't produce a violation: `**co\*\*\*\*ha**bitation **pro**ject`
Author
Owner

@wvanderp commented on GitHub (Jun 21, 2022):

My goal is to highlight co, ha, and pro.

So that it is cohabilitation project

Although I see now that removing the asterisks between the letters is a better option and that GitHubs markdown parser also struggles with my notation

**Co****ha**bilitation **pro**ject results in Co****habilitation project

<!-- gh-comment-id:1161984542 --> @wvanderp commented on GitHub (Jun 21, 2022): My goal is to highlight co, ha, and pro. So that it is **coha**bilitation **pro**ject Although I see now that removing the asterisks between the letters is a better option and that GitHubs markdown parser also struggles with my notation `**Co****ha**bilitation **pro**ject` results in **Co****ha**bilitation **pro**ject
Author
Owner
<!-- gh-comment-id:1162164636 --> @DavidAnson commented on GitHub (Jun 21, 2022): If your intent is not to include the asterisks, then your original text is not what do you want under CommonMark: http://markdown-it.github.io/#md3=%7B%22source%22%3A%22%2A%2Aco%2A%2A%2A%2Aha%2A%2Abitation%20%2A%2Apro%2A%2Aject%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%3Afalse%2C%22_view%22%3A%22html%22%7D%7D Why not just `**coha**` like you did with "project"?
Author
Owner

@wvanderp commented on GitHub (Jun 21, 2022):

Thank you for working through the problem with me.

So my practical problem is solved now. But now, we are left with a theoretical problem.

When I look at the "ast" on the page you linked, then co****ha is marked as plain text surrounded by bold tags.
and by extension, it doesn't have any problems

The inclusion of asterisks in the bolt tags messes up the parsing done by this program. Because it things bilitation is inside of the tags.

You can put this report at the bottom of the pile or close it because who would put asterisks inside of bold tags :)
but I do honestly think that this is something to someday look at.

Thanks again for the quick responses and the help

<!-- gh-comment-id:1162217340 --> @wvanderp commented on GitHub (Jun 21, 2022): Thank you for working through the problem with me. So my practical problem is solved now. But now, we are left with a theoretical problem. When I look at the "ast" on the page you linked, then `co****ha` is marked as plain text surrounded by bold tags. and by extension, it doesn't have any problems The inclusion of asterisks in the bolt tags messes up the parsing done by this program. Because it things `bilitation ` is inside of the tags. You can put this report at the bottom of the pile or close it because who would put asterisks inside of bold tags :) but I do honestly think that this is something to someday look at. Thanks again for the quick responses and the help
Author
Owner

@DavidAnson commented on GitHub (Jun 21, 2022):

Yes, thanks, I am leaving this open because I really try not to report issues against valid Markdown.

<!-- gh-comment-id:1162272125 --> @DavidAnson commented on GitHub (Jun 21, 2022): Yes, thanks, I am leaving this open because I really try not to report issues against valid Markdown.
Author
Owner

@DavidAnson commented on GitHub (Jun 22, 2022):

I'm going to tag this "Enhancement" instead of "Bug" which is technically a cheat, but this feels like a pretty unlikely scenario with seemingly unpredictable behavior that I think simple regular expression parsing isn't going to be able to deal with easily: example.

<!-- gh-comment-id:1162601009 --> @DavidAnson commented on GitHub (Jun 22, 2022): I'm going to tag this "Enhancement" instead of "Bug" which is technically a cheat, but this feels like a pretty unlikely scenario with seemingly unpredictable behavior that I think simple regular expression parsing isn't going to be able to deal with easily: [example](https://dlaa.me/markdownlint/#%25m%23%20Issue%20533%0A%0A**text*text**text%20**text**text%0A%0A**text**text**text%20**text**text%0A%0A**text***text**text%20**text**text%0A%0A**text****text**text%20**text**text%0A%0A**text*****text**text%20**text**text%0A%0A**text******text**text%20**text**text%0A%0A**text*******text**text%20**text**text%0A).
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#433
No description provided.