mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
Merge 64dabd2a12 into bacd19c4ea
This commit is contained in:
commit
5251b7e138
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user