From 64dabd2a12ca5a563332882011a1c4fb361c535e Mon Sep 17 00:00:00 2001 From: Antonin Adert Date: Sun, 7 Sep 2025 14:02:52 +0200 Subject: [PATCH] Fix links case sensitivity in path.ts Taking and improving fix by @valentynkt #1123 and fixing bug #1122 (Case Sensitivity Issue in Markdown Links Leads to 404 Errors) --- quartz/util/path.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quartz/util/path.ts b/quartz/util/path.ts index b95770159..8a65cb110 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -237,11 +237,12 @@ export function transformLink(src: FullSlug, target: string, opts: TransformOpti let [targetCanonical, targetAnchor] = splitAnchor(canonicalSlug) if (opts.strategy === "shortest") { + const lowerCaseTargetCanonical = targetCanonical.toLowerCase() // if the file name is unique, then it's just the filename const matchingFileNames = opts.allSlugs.filter((slug) => { const parts = slug.split("/") const fileName = parts.at(-1) - return targetCanonical === fileName + return lowerCaseTargetCanonical === (fileName?.toLowerCase() ?? "") }) // only match, just use it