DavidAnson / markdownlint

A Node.js style checker and lint tool for Markdown/CommonMark files.
MIT License
4.71k stars 715 forks source link

[Feature Request] Checking Space around Embedded Code, Bold and Italic #1298

Open fyc09 opened 1 month ago

fyc09 commented 1 month ago

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代码

fyc09 commented 1 month ago

@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

DavidAnson commented 1 month ago

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.