[GH-ISSUE #804] MD037 false-positive for underscore-emphasized strings when like-strings are in the same paragraph #539

Closed
opened 2026-03-03 01:27:50 +03:00 by kerem · 0 comments
Owner

Originally created by @pbredenberg on GitHub (May 4, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/804

When using underscores for emphasis, MD037 is triggered when two strings with underscore characters emphasized with an underscore occur in the same paragraph.

The rule does not trigger errors when they occur in different paragraphs.

Here's an MRE demonstrating the issue

Pipeline showing the error

Passes:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore _abc_123_abc_baby_u_n_me_.

Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex _do_re_mi_.

Fails:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore _abc_123_abc_baby_u_n_me_. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex _do_re_mi_.

In the document in question, I switched from using underscores for emphasis to backticks, since they are representative of encoded strings, but thought I'd note the issue anyway.

Originally created by @pbredenberg on GitHub (May 4, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/804 When using underscores for emphasis, MD037 is triggered when two strings with underscore characters emphasized with an underscore occur in the same paragraph. The rule does not trigger errors when they occur in different paragraphs. Here's an [MRE demonstrating the issue](https://github.com/pbredenberg/markdownlint-md037-false-posiitive) [Pipeline showing the error](https://github.com/pbredenberg/markdownlint-md037-false-posiitive/actions/runs/4758744266/jobs/8457178824#step:6:14) Passes: ```markdown Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore _abc_123_abc_baby_u_n_me_. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex _do_re_mi_. ``` Fails: ```markdown Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore _abc_123_abc_baby_u_n_me_. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex _do_re_mi_. ``` In the document in question, I switched from using underscores for emphasis to backticks, since they are representative of encoded strings, but thought I'd note the issue anyway.
kerem 2026-03-03 01:27:50 +03:00
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#539
No description provided.