[GH-ISSUE #280] MD037 does not ignore '_' in link reference #240

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

Originally created by @acascone on GitHub (Apr 30, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/280

In vscode, I see a warning for _Setup_ and _Installation_ complaining about "Spaces inside emphasis markers" for _ and _ but no error for *Setup* and *Installation*.

I assume that the behavior with the asterisk is correct, and the underscore is incorrect. I hope the underscore is not the correct interpretation of the rule.

Originally created by @acascone on GitHub (Apr 30, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/280 In vscode, I see a warning for `_Setup_ and _Installation_` complaining about "Spaces inside emphasis markers" for `_ and _` but no error for `*Setup* and *Installation*`. I assume that the behavior with the asterisk is correct, and the underscore is incorrect. I hope the underscore is not the correct interpretation of the rule.
kerem 2026-03-03 01:25:00 +03:00
Author
Owner

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

Could you please check you are on the latest version? There was a recent fix in this area in extension release 0.35.1.

Your example looks fine to me in the current implementation: https://dlaa.me/markdownlint/#%25m%23%20Issue%20114%0A%0A_Setup_%20and%20_Installation_%0A%0ASetup%20and%20Installation%0A

<!-- gh-comment-id:622521343 --> @DavidAnson commented on GitHub (May 1, 2020): Could you please check you are on the latest version? There was a recent fix in this area in extension release 0.35.1. Your example looks fine to me in the current implementation: https://dlaa.me/markdownlint/#%25m%23%20Issue%20114%0A%0A_Setup_%20and%20_Installation_%0A%0A*Setup*%20and%20*Installation*%0A
Author
Owner

@acascone commented on GitHub (May 1, 2020):

Thanks for getting back to me. Here are some additional details.

VS Code Version

Version: 1.44.2
Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd
Date: 2020-04-16T17:50:03.709Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.4.0-26-generic

Extension Version

Name: markdownlint
Id: davidanson.vscode-markdownlint
Description: Markdown linting and style checking for Visual Studio Code
Version: 0.35.1
Publisher: David Anson
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint

I still see the issue.

{
	"resource": "<filename>",
	"owner": "markdownlint",
	"code": "MD037",
	"severity": 4,
	"message": "MD037/no-space-in-emphasis: Spaces inside emphasis markers",
	"source": "markdownlint",
	"startLineNumber": 20,
	"startColumn": 7,
	"endLineNumber": 20,
	"endColumn": 14
}

I am using the following format file.

{
  "default" : true,
  "MD013": { "line_length": 110 },
  "MD024": { "siblings_only": true },
  "MD029": { "style": "one_or_ordered" }
}

Please let me know what else I can try.

<!-- gh-comment-id:622527459 --> @acascone commented on GitHub (May 1, 2020): Thanks for getting back to me. Here are some additional details. VS Code Version ``` Version: 1.44.2 Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd Date: 2020-04-16T17:50:03.709Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Linux x64 5.4.0-26-generic ``` Extension Version ``` Name: markdownlint Id: davidanson.vscode-markdownlint Description: Markdown linting and style checking for Visual Studio Code Version: 0.35.1 Publisher: David Anson VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint ``` I still see the issue. ``` { "resource": "<filename>", "owner": "markdownlint", "code": "MD037", "severity": 4, "message": "MD037/no-space-in-emphasis: Spaces inside emphasis markers", "source": "markdownlint", "startLineNumber": 20, "startColumn": 7, "endLineNumber": 20, "endColumn": 14 } ``` I am using the following format file. ``` { "default" : true, "MD013": { "line_length": 110 }, "MD024": { "siblings_only": true }, "MD029": { "style": "one_or_ordered" } } ``` Please let me know what else I can try.
Author
Owner

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

Please include example Markdown that demonstrates the issue. Per my link above, the simplified version does not seem to.

<!-- gh-comment-id:622649224 --> @DavidAnson commented on GitHub (May 2, 2020): Please include example Markdown that demonstrates the issue. Per my link above, the simplified version does not seem to.
Author
Owner

@acascone commented on GitHub (May 2, 2020):

Ok, I feel like I might have wasted your time. It's related to a reference style link on the line before.

Please see: https://dlaa.me/markdownlint/#%25m%23%20Issue%20114%0A%0A%5Breference_link%5D%0A_Setup_%20and%20_Installation_%20%3C--%20issue%0A%0A%5Breference_link%5D%0ASetup%20and%20Installation%20%3C--%20no%20issue%0A%0A%5Breference_link%5D%3A%20http%3A%2F%2Fwww.example.com%0A

EDIT: updated to show issue with underscore vs not, but still this seems like user error. It was just unexpected.

<!-- gh-comment-id:622651618 --> @acascone commented on GitHub (May 2, 2020): Ok, I feel like I might have wasted your time. It's related to a reference style link on the line before. Please see: https://dlaa.me/markdownlint/#%25m%23%20Issue%20114%0A%0A%5Breference_link%5D%0A_Setup_%20and%20_Installation_%20%3C--%20issue%0A%0A%5Breference_link%5D%0A*Setup*%20and%20*Installation*%20%3C--%20no%20issue%0A%0A%5Breference_link%5D%3A%20http%3A%2F%2Fwww.example.com%0A EDIT: updated to show issue with underscore vs not, but still this seems like user error. It was just unexpected.
Author
Owner

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

You are correct that this is a bug in markdownlint. ‘_’ is allowed in a link label, so ideally the linter would recognize that and not try to treat it as the start of an emphasis. Thank you for the example – I will look to improve this in a future release.

<!-- gh-comment-id:622673364 --> @DavidAnson commented on GitHub (May 2, 2020): You are correct that this is a bug in markdownlint. ‘_’ is allowed in a link label, so ideally the linter would recognize that and not try to treat it as the start of an emphasis. Thank you for the example – I will look to improve this in a future release.
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#240
No description provided.