This commit is contained in:
RYO KOBAYASHI 2026-01-29 05:38:44 +01:00 committed by GitHub
commit 96906b3693
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 === fileName
if (!fileName) return false
return normalizedTarget === fileName.normalize("NFC")
})
// only match, just use it