Skip to content

getLinkAtPositionTarget

Resolves the note a link found by getLinkAtPosition points at, through metadataCache.getFirstLinkpathDest. A link into the same note ([[#Heading]]) resolves to that note.

Import:

import { getLinkAtPositionTarget } from '@mnaoumov/obsidian-lib/link-at-position';

Signature:

function getLinkAtPositionTarget(params: GetLinkAtPositionTargetParams): TFile | null

Parameters:

Parameter Type Description
params GetLinkAtPositionTargetParams The app, the link and the path of the note holding it.

Returns: TFile | null — The target file, or null for an external link or an unresolved one.


Links to this page: