From 5b41abff971548a064602397a6b5792b3f1e9143 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 2 Nov 2023 10:45:47 +0100 Subject: [PATCH] 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. --- website/remote-content/shared.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/remote-content/shared.js b/website/remote-content/shared.js index 137fadc5a1..df25be0260 100644 --- a/website/remote-content/shared.js +++ b/website/remote-content/shared.js @@ -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}`; }