From 64729211d1af24e48ba47734a8be0e14ce662ced Mon Sep 17 00:00:00 2001 From: Ryo KOBAYASHI Date: Sat, 20 Dec 2025 14:01:21 +0900 Subject: [PATCH 1/3] fix unicode string matching to use string.normalize(). --- quartz/util/path.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/util/path.ts b/quartz/util/path.ts index b95770159..3bc3460bd 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -241,7 +241,7 @@ export function transformLink(src: FullSlug, target: string, opts: TransformOpti const matchingFileNames = opts.allSlugs.filter((slug) => { const parts = slug.split("/") const fileName = parts.at(-1) - return targetCanonical === fileName + return targetCanonical.normalize() === fileName.normalize() }) // only match, just use it From 9a55df4d2fd8be862ee91782f3d676b7bccc2b53 Mon Sep 17 00:00:00 2001 From: Ryo KOBAYASHI Date: Sun, 28 Dec 2025 13:36:53 +0900 Subject: [PATCH 2/3] fix the code to handle cases where 'fileName' is undefined. --- quartz/util/path.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quartz/util/path.ts b/quartz/util/path.ts index 3bc3460bd..29481d738 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -238,10 +238,12 @@ export function transformLink(src: FullSlug, target: string, opts: TransformOpti if (opts.strategy === "shortest") { // if the file name is unique, then it's just the filename + const normalizedTarget = targetCanonical.normalize("NFC") const matchingFileNames = opts.allSlugs.filter((slug) => { const parts = slug.split("/") const fileName = parts.at(-1) - return targetCanonical.normalize() === fileName.normalize() + if (!fileName) return false + return normalizedTarget === fileName.normalize("NFC") }) // only match, just use it From 8bbc8c99a0518fe2c4f54fb6491a512d9e3035b2 Mon Sep 17 00:00:00 2001 From: Ryo KOBAYASHI Date: Sun, 28 Dec 2025 13:58:42 +0900 Subject: [PATCH 3/3] apply prettier to the modified file. --- quartz/util/path.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/util/path.ts b/quartz/util/path.ts index 29481d738..c1e502339 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -238,7 +238,7 @@ export function transformLink(src: FullSlug, target: string, opts: TransformOpti if (opts.strategy === "shortest") { // if the file name is unique, then it's just the filename - const normalizedTarget = targetCanonical.normalize("NFC") + const normalizedTarget = targetCanonical.normalize("NFC") const matchingFileNames = opts.allSlugs.filter((slug) => { const parts = slug.split("/") const fileName = parts.at(-1)