( notes: RenameNoteRef[], target: string )
| 68 | } |
| 69 | |
| 70 | export function resolveWikilinkTarget( |
| 71 | notes: RenameNoteRef[], |
| 72 | target: string |
| 73 | ): RenameNoteRef | null { |
| 74 | const visible = notes.filter((note) => note.folder !== 'trash') |
| 75 | if (isPathLikeWikilinkTarget(target)) { |
| 76 | return resolveExplicitPath(visible, target) ?? resolvePathSuffix(visible, target) |
| 77 | } |
| 78 | const needle = normalizeForCompare(stripMdExtension(target)) |
| 79 | return visible.find((note) => normalizeForCompare(note.title) === needle) ?? null |
| 80 | } |
| 81 | |
| 82 | /** Split `[[ ... ]]` inner text into target, `#heading`/`^block` anchor, and |
| 83 | * `|alias` — the anchor/alias keep their leading delimiter so the link can be |
no test coverage detected