GithubHelp home page GithubHelp logo

Comments (3)

DavidAnson avatar DavidAnson commented on July 19, 2024

Link text is usually meant to be descriptive, so I think the current behavior is a sensible default. But your scenario makes sense as well, so I would be inclined to add an option to exempt link text from this rule to enable it. Would that work?

from markdownlint.

jerryjappinen avatar jerryjappinen commented on July 19, 2024

That would work for me yeah in this case.

However I still couldn't write "the domain name of GitHub is github.com" anywhere without getting an error, so I wonder if we could handle this in a more generic way. If I do have both "github.com" and "GitHub" in my configuration, what is the expected behavior? Does the order matter?

What I've been writing documentation for a my vue-webpack project template and I noticed that I wanted to do the following:

  • Vue should be written with a capital V
  • Vue.js should also be written with a capital V
  • vue.js as a file name should be written with lowercase if that's what the file is called. Not a problem since I use code blocks for file names and those are exempt, and there wouldn't be any way for the linter to tell the difference anyhow.
  • Vuex is the name of a separate library which should be written with a capital V. Not a problem, linter doesn't give false positives.
  • But vue-router is also a separate library, which should be written with a lowercase v. I get an error from the linter even if I have "vue-router" or "vue-" in my configuration in addition to "Vue". This makes sense if I think about the implementation (dash is a punctuation character), but I think it's actually a common use case (for example many plugins for ESLint have all lowercase names with the string -eslint- included) and there should be a way to handle this.

I worked around this issue by enclosing all names that look like this in code blocks, which is fine (ish) for me, but they're not all package names and the same issue comes up with other stylised names or domain names used outside of link texts.

There's probably way more complexity in here that makes sense to try to tackle with this feature of a simple linter, but anyways it's interesting to consider. Perhaps there's an easy solution here somewhere that might involve checking if a string is whitelisted in the config before the linter warns about it, whitelisting all URL patterns or something else.

from markdownlint.

DavidAnson avatar DavidAnson commented on July 19, 2024

Interesting scenario! Order should not matter, so I don't think that will help you. I'll create a test file from your examples above and play around with it soon. Some ideas I'll explore are exempting link text and treating period/hyphen as part of the word. I'd rather not support regular expressions, but that may be something else to consider. Thanks again, please let me know if there are other tricky scenarios here!

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.