Skip to content

Commit

Permalink
fix(docs): lowercase internal markdown links (#4963)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thomasheartman authored Nov 2, 2023
1 parent cbc89f6 commit 5b41abf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/remote-content/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
Expand Down

0 comments on commit 5b41abf

Please sign in to comment.