mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-02-03 22:15:42 -06:00
Merge 8bbc8c99a0 into ec00a40aef
This commit is contained in:
commit
96906b3693
@ -238,10 +238,12 @@ export function transformLink(src: FullSlug, target: string, opts: TransformOpti
|
|||||||
|
|
||||||
if (opts.strategy === "shortest") {
|
if (opts.strategy === "shortest") {
|
||||||
// if the file name is unique, then it's just the filename
|
// if the file name is unique, then it's just the filename
|
||||||
|
const normalizedTarget = targetCanonical.normalize("NFC")
|
||||||
const matchingFileNames = opts.allSlugs.filter((slug) => {
|
const matchingFileNames = opts.allSlugs.filter((slug) => {
|
||||||
const parts = slug.split("/")
|
const parts = slug.split("/")
|
||||||
const fileName = parts.at(-1)
|
const fileName = parts.at(-1)
|
||||||
return targetCanonical === fileName
|
if (!fileName) return false
|
||||||
|
return normalizedTarget === fileName.normalize("NFC")
|
||||||
})
|
})
|
||||||
|
|
||||||
// only match, just use it
|
// only match, just use it
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user