[GH-ISSUE #218] MD037 does not detect spaces in *** inlines when used to apply emphasis+strong together #187

Closed
opened 2026-03-03 01:24:31 +03:00 by kerem · 3 comments
Owner

Originally created by @TheJaredWilcurt on GitHub (Aug 27, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/218

MD037 only handles strong, not em or both. This is inconsistent with how it is documented.

This does not throw an error
✔️ This throws error:

Text * text *.

✔️ This throws error:

Text ** text **.

This does not throw an error

Text *** text ***.
Originally created by @TheJaredWilcurt on GitHub (Aug 27, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/218 **MD037** only handles strong, not em or both. This is inconsistent with how it is documented. * https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md037---spaces-inside-emphasis-markers ~~❌ This does not throw an error~~ ✔️ This throws error: ```md Text * text *. ``` ✔️ This throws error: ```md Text ** text **. ``` ❌ This does not throw an error ```md Text *** text ***. ```
kerem 2026-03-03 01:24:31 +03:00
Author
Owner

@DavidAnson commented on GitHub (Aug 28, 2019):

As written, the first example is a single-item list, so should not error. If used in a paragraph context, it errors as expected. The third example is not a valid emphasis, so should not error.

Here are those examples as parsed by markdown-it: https://dlaa.me/markdownlint/#%25m%23%20218%0A%0A*%20text%20*%0A%0AText%20*%20text%20*%0A%0A**%20text%20**%0A%0A***%20text%20***%0A

<!-- gh-comment-id:525538822 --> @DavidAnson commented on GitHub (Aug 28, 2019): As written, the first example is a single-item list, so should not error. If used in a paragraph context, it errors as expected. The third example is not a valid emphasis, so should not error. Here are those examples as parsed by `markdown-it`: https://dlaa.me/markdownlint/#%25m%23%20218%0A%0A*%20text%20*%0A%0AText%20*%20text%20*%0A%0A**%20text%20**%0A%0A***%20text%20***%0A
Author
Owner

@TheJaredWilcurt commented on GitHub (Aug 28, 2019):

Padding with spaces on any of them is invalid.

This is *em*.
This is **strong**.
This is ***em and strong***.

This is invalid * em *.
This is invalid ** strong **.
This is invalid *** em and strong ***.

Line 9 should still be caught.

<!-- gh-comment-id:525720637 --> @TheJaredWilcurt commented on GitHub (Aug 28, 2019): Padding with spaces on any of them is invalid. ```md This is *em*. This is **strong**. This is ***em and strong***. This is invalid * em *. This is invalid ** strong **. This is invalid *** em and strong ***. ``` * https://dlaa.me/markdownlint/#%25m%23%20218%0A%0AThis%20is%20*em*.%20%20%0AThis%20is%20**strong**.%20%20%0AThis%20is%20***em%20and%20strong***.%0A%0AThis%20is%20*%20em%20*.%20%20%0AThis%20is%20**%20strong%20**.%20%20%0AThis%20is%20***%20em%20and%20strong%20***.%0A Line 9 should still be caught.
Author
Owner

@DavidAnson commented on GitHub (Aug 28, 2019):

Agreed. Thanks for the example!

<!-- gh-comment-id:525815110 --> @DavidAnson commented on GitHub (Aug 28, 2019): Agreed. Thanks for the example!
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#187
No description provided.