[GH-ISSUE #1298] [Feature Request] Checking Space around Embedded Code, Bold and Italic #2504

Open
opened 2026-03-07 20:08:23 +03:00 by kerem · 4 comments
Owner

Originally created by @fyc09 on GitHub (Jul 16, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1298

Adding spaces around embedded code, bold, and italics is common practice to prevent unexpected rendering errors and make words recognizable. While Chinese can be recognized without spaces, adding spaces can enhance clarity and readability.

Correct:

some *important* point
some `inline` code
一些 *重要* 的信息
一些 `inline` 代码

some important point
some inline code
一些 重要 的信息
一些 inline 代码

Incorrect:

some*important*point
some`inline`code
一些*重要*的信息
一些`inline`代码

someimportantpoint
someinlinecode
一些重要的信息
一些inline代码

Originally created by @fyc09 on GitHub (Jul 16, 2024). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1298 Adding spaces around embedded code, bold, and italics is common practice to prevent unexpected rendering errors and make words recognizable. While Chinese can be recognized without spaces, adding spaces can enhance clarity and readability. Correct: ```markdown some *important* point some `inline` code 一些 *重要* 的信息 一些 `inline` 代码 ``` some *important* point some `inline` code 一些 *重要* 的信息 一些 `inline` 代码 Incorrect: ```markdown some*important*point some`inline`code 一些*重要*的信息 一些`inline`代码 ``` some*important*point some`inline`code 一些*重要*的信息 一些`inline`代码
Author
Owner

@fyc09 commented on GitHub (Jul 17, 2024):

@DavidAnson Can we use micromark as the parser in customRules to simplify column calculations?
github.com/DavidAnson/markdownlint@b2305efafb/lib/markdownlint.js (L58-L66)

<!-- gh-comment-id:2232228856 --> @fyc09 commented on GitHub (Jul 17, 2024): @DavidAnson Can we use micromark as the parser in customRules to simplify column calculations? https://github.com/DavidAnson/markdownlint/blob/b2305efafb034b1f328845aec9928b5363ffd646/lib/markdownlint.js#L58-L66
Author
Owner

@DavidAnson commented on GitHub (Jul 17, 2024):

Not yet. I want to convert the remaining core rules to micromark first, then review the API. Custom rules can still use markdown-it and the "helpers" package, but I am slowly removing things from that as I migrate, so feel free to use or copy from earlier versions.

<!-- gh-comment-id:2232241068 --> @DavidAnson commented on GitHub (Jul 17, 2024): Not yet. I want to convert the remaining core rules to micromark first, then review the API. Custom rules can still use markdown-it and the "helpers" package, but I am slowly removing things from that as I migrate, so feel free to use or copy from earlier versions.
Author
Owner

@Faker095 commented on GitHub (Dec 29, 2024):

if (
!result &&
(rule.parser !== undefined) &&
(rule.parser !== "markdownit") &&
!((customIndex < 0) && (rule.parser === "micromark")) &&
(rule.parser !== "none")
) {
result = newError("parser", rule.parser);
}

<!-- gh-comment-id:2564707463 --> @Faker095 commented on GitHub (Dec 29, 2024): if ( !result && (rule.parser !== undefined) && (rule.parser !== "markdownit") && !((customIndex < 0) && (rule.parser === "micromark")) && (rule.parser !== "none") ) { result = newError("parser", rule.parser); }
Author
Owner

@DavidAnson commented on GitHub (Dec 29, 2024):

@fyc09, i'm not sure what the comment above is saying, but to get back to your question from six months ago, it is now possible to write custom rules that use the micromark parser. As you say, the line/column information should be easier to work with in that form. If you have any trouble, please let me know!

<!-- gh-comment-id:2564820725 --> @DavidAnson commented on GitHub (Dec 29, 2024): @fyc09, i'm not sure what the comment above is saying, but to get back to your question from six months ago, it is now possible to write custom rules that use the micromark parser. As you say, the line/column information should be easier to work with in that form. If you have any trouble, please let me know!
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#2504
No description provided.