-
-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to ignore HTML elements and content to MD044/proper-names #435
Comments
There are a lot of places a file name might appear. The new implementation of this rule probably finds more instances which is why you've filed this. But I'm not sure I want to add a bunch of exceptions. What about adding "javascript.png" to your allowed word list kind of how "GitHub"/"github.com" is handled here: https://github.com/DavidAnson/markdownlint/blob/main/test/proper-names-projects.json |
But it used to work in previous version the better way. It didn't find violations in file names, but it found everywhere else. We don't use capitalization in file names, and I believe it's a general rule. And with the latest version I now have 159 errors in my documentation, and it doesn't make sense to add all these exceptions. Isn't there any simple algorithm that can detect file name, or at least an HTML attribute |
I think the previous implementation of this rule missed things like text in HTML alt and title attributes, so this is an improvement. Are all 159 new issues in your case unique? If there are duplicates like I'm expecting, a few new entries in the word list will solve the problem. Can you give some other examples, please? |
@DavidAnson, I examined the errors, and I may say, the most of them are pretty unique. Because they are (suppose
|
It looks like the request to ignore file names would only avoid some of these scenarios, so would be a partial solution for you at best. This project is a linting tool for Markdown and it seems all of your examples use HTML. It's true that HTML can be used in Markdown, but many consider that to be an anti-pattern. Rule MD033/no-inline-html warns against doing so. I'm not expecting to add a bunch of HTML handling to support the variety of examples you show, but I will leave the issue open for comment. |
@DavidAnson, what if to add a parameter that would disable this rule for embedded HTML at all? So this rule would work as it had been working before. Anyway HTML is not get checked correctly. And anyway you say HTML is not recommended in Markdown. That would work for me, I believe. |
We've just run into this issue as well with mixed Markdown and HTML, with instances in If there was an option to ignore HTML with this rule, I'd turn it on as preferable to the current situation; but as it's been pointed out, it would miss out on I think being able to ignore situations where the triggering word is "filename-y" (kebab-case, not surrounded by whitespace, etc.) would be very useful, probably realistic to implement, and getting closer (even if not perfect) to eliminating false positives. As it stands now, we unfortunately have to turn off this rule completely. |
"MD044": {"names": ["JavaScript", "javascript"]} I think both of |
@chriswong I would have expected that as well. The code handles matching substrings by sorting in order of length, but that does not help here where two names differ only in case. I included an example of the problem below and have added a note to myself to look into this. Thank you! |
…he same name (ex: "Abc" and "ABC") (refs #435).
The first commit addresses the |
@DavidAnson, thanks, I will try your fixes! |
@DavidAnson, it’s actually not so easy to try this out, as Is there an easy way to check? |
The easiest thing is probably to clone this repository into the markdownlint folder under node_modules of the CLI. Or wait a little longer because I am getting close to doing another round of releases. |
@DavidAnson, I was able to test it with a symlink, and However, things like |
I read, that it's a known issue. In my case |
Capital letters are rarely used in file names due to multiple reasons. But:
Gives:
This problem has appeared in
v0.24.0
.The text was updated successfully, but these errors were encountered: