-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Broken link check is case-insensitive #9057
Comments
Are you using Mac/Windows? Our route matching algorithm uses the file system API to decide if the respective file exists, and Mac/Windows is case-insensitive. You would get case-sensitive behavior on Linux (which I would assume most deployment systems are). I don't know if we want to add additional complexity of determining whether your file server is case-sensitive because most servers seem to be case-insensitive. |
@Josh-Cena I am using Ubuntu 22.04.2 LTS, and having this issue, so I don't think |
Makes sense to me 👍 We should match sensitively by default, but this might prevent existing sites from building so it's a breaking change. I will try to do the change for v3 and provide a secret env variable in case it's annoying for some users (also useful until their bad links get fixed). Eventually, we can add an option to decide how the broken link checker should match, but let's wait first to see if users complain and if this is really needed. |
Note to myselflost 1h investigating this and it's a bit more complicated.
And this function is case-insensitive on case-insensitive filesystems: async function isExistingFile(filePath: string) {
try {
return (await fs.stat(filePath)).isFile();
} catch {
return false;
}
} I'm not sure of the benefits of keeping Need to study this more in-depth, but now is not the ideal time. |
Hi @slorber will this be continued? |
Until v3 is released this issue is not a short term goal to fix |
As part of the v3.1 broken anchor checker:
We removed the weird Now the broken link checking is case sensitive, see playground: |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Hey. Not sure, is it a bug, or a feature, but currently the broken links check by Docusaurus is case-insensitive. It would be case-sensitive if
routes
objects used for the match hadsensitive: true
flags, but currently they don't have this field. The case-sensitivity matters if generated documentation is served from a service, like Google.Cloud Storage, which treats file URLs in case-sensitive manner.Reproducible demo
No response
Steps to reproduce
N/A
Expected behavior
N/A
Actual behavior
N/A
Your environment
Self-service
The text was updated successfully, but these errors were encountered: