GithubHelp home page GithubHelp logo

Comments (8)

tommy-gilligan avatar tommy-gilligan commented on August 19, 2024 1

Another possible criteria for which link style to use: whether or not the link destination is relative
eg.
[read destination docs](./destination/README.md)
vs
[read destination docs](https://example.com/destination)

from markdownlint.

DavidAnson avatar DavidAnson commented on August 19, 2024

Can you please give some examples to be sure I understand the request? I searched "for inline-style" links and it suggests something like the following:

<a href="..." style="something">...</a>

If so, does rule MD033 Inline HTML help? It can be used to block HTML content which should cover the first of your three scenarios.

Also, why are lists special with regard to inline-style links? Would blockquotes deserve similar treatment? Tables? Just lists?

Thanks for the clarification!

from markdownlint.

pascalberger avatar pascalberger commented on August 19, 2024

No, I didn't mean inline HTML. Some examples to clarify:

Good:

Lorem ipsum dolor sit amet, [consectetur adipiscing] elit. Etiam lectus dui, laoreet eget mauris eget, interdum blandit risus. Vestibulum ac ornare dolor, et tincidunt nulla. Suspendisse vitae dolor nec ipsum vehicula varius non et diam. Vivamus finibus libero sed tincidunt accumsan. Aliquam erat volutpat. Donec faucibus, neque ac semper blandit, est lacus placerat purus, a blandit magna diam et lorem. Maecenas tincidunt iaculis eleifend. In bibendum elementum ex, sit amet pharetra est efficitur at. 

[consectetur adipiscing]: http://example.com

Bad, if not Allow all inline-style links is set:

Lorem ipsum dolor sit amet, [consectetur adipiscing](http://example.com) elit. Etiam lectus dui, laoreet eget mauris eget, interdum blandit risus. Vestibulum ac ornare dolor, et tincidunt nulla. Suspendisse vitae dolor nec ipsum vehicula varius non et diam. Vivamus finibus libero sed tincidunt accumsan. Aliquam erat volutpat. Donec faucibus, neque ac semper blandit, est lacus placerat purus, a blandit magna diam et lorem. Maecenas tincidunt iaculis eleifend. In bibendum elementum ex, sit amet pharetra est efficitur at. 

Good, if Allow inline-style links in lists is set:

* [Google](https://google.com)
* [Bing](https://bing.com)

The general idea behind the rule would be that inline-style links makes the Markdown source file harder to read. The exception for lists is that IMHO if you make a list of just links, it's easier to read if using inline-style than reference-style links, since the link is the whole content there. More precise this exception should only be valid if there is no additional text in the list, but don't know if this is possible :)

from markdownlint.

DavidAnson avatar DavidAnson commented on August 19, 2024

Makes perfect sense, thank you!

from markdownlint.

bhrutledge avatar bhrutledge commented on August 19, 2024

For completeness, an option to disallow reference links would be nice, and/or a "consistent" option, ala ul-style.

from markdownlint.

waldyrious avatar waldyrious commented on August 19, 2024

Re-adding comment from #321, which was closed as a duplicate:

It would also be nice if this was configurable by the length of the URL — i.e. non-reference links shorter than N characters would not trigger this rule, with the default max length being 0.

from markdownlint.

tommy-gilligan avatar tommy-gilligan commented on August 19, 2024

Should autolinks be allowed?

from markdownlint.

tommy-gilligan avatar tommy-gilligan commented on August 19, 2024

Should autolinks be allowed?

Tentatitve decision: Autolinks should be ignored

Allow inline-style links in lists only

Another possible criteria for which link style to use: whether or not the link destination is relative

It would also be nice if this was configurable by the length of the URL — i.e. non-reference links shorter than N characters would not trigger this rule, with the default max length being 0.

Tentatitve decision: All of these should be configurable but it is not clear to me what that should look like in the schema.

from markdownlint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.