markdownlint icon indicating copy to clipboard operation
markdownlint copied to clipboard

New rule: link simplification

Open mathbunnyru opened this issue 4 years ago • 3 comments

A link like this [https://github.com](https://github.com) can be easily simplified to <https://github.com>. This way it's less code duplication and it is easier to read.

mathbunnyru avatar May 22 '21 21:05 mathbunnyru

@DavidAnson could you please give me an example of the PR or commit, which adds a new feature similar to this one? I will try to implement it, though I don't know Node.js at all (so it will take some time).

mathbunnyru avatar May 24 '21 19:05 mathbunnyru

Here is the most recent one: https://github.com/DavidAnson/markdownlint/pull/224

There is a complicating factor here that there is a collection of link-related rule requests I would ultimately like to bundle into one rule. I do not blame you if you do not want to wade into that, but if you do I will probably be a little pickier than usual. Fair warning. :)

DavidAnson avatar May 24 '21 22:05 DavidAnson

Thanks for the warning 😂 I will take a look at what I can do.

mathbunnyru avatar May 24 '21 22:05 mathbunnyru

For anyone looking to implement this, #753 contains a bit additional information and corner cases to consider.

Marcono1234 avatar May 28 '23 13:05 Marcono1234

@DavidAnson, will this be fixed by the new rule MD054?

Though if I see it correctly, that new rule is only about allowing / disallowing certain link styles. But if I understand the author of this issue here correctly, the suggestion was to enforce a link style (autolink) depending on the link content, and not generally.

Or will that be tracked in #753 in the future? (technically that issue is a duplicate of this one here, but it covers more cases, including reference links)

Marcono1234 avatar Nov 12 '23 18:11 Marcono1234

Agree this is more like 753. I expect to push changes that implement that tonight.

DavidAnson avatar Nov 12 '23 18:11 DavidAnson