1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix(docs): lowercase internal markdown links (#4963)

Markdown generators (including GitHub) tend to lowercase the titles
when they create anchor links. It appears that the intra-doc links might
not work correctly if they're incorrectly cased.

This fixes the issue by lowercasing any links we find to internal
headers in external documents (such as the SDKs and Edge/Proxy docs).

## Discussion point

Now, there is one potential issue with this: if someone creates an
explicit link in the SDKs that uses uppercase letters, then this might
break the docs build in the future.

However, I think this is unlikely to happen any time soon, and I would
think that it's more likely that people will incorrectly case the header
link.
This commit is contained in:
Thomas Heartman 2023-11-02 10:45:47 +01:00 committed by GitHub
parent cbc89f6a92
commit 5b41abff97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ const replaceLinks = ({ content, repo }) => {
// case 1
if (url.startsWith('#')) {
// ignore links to other doc sections
return url;
return url.toLowerCase();
} else {
return `${repo.url}/blob/${repo.branch}${separator}${url}`;
}