Skip to content

LinkAtPosition

The link found at a position by getLinkAtPosition.

Import:

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

Signature:

export interface LinkAtPosition

Properties

PropertyTypeDescription
endChnumberThe column just past the link's raw text on line.
frontmatterKeynull | stringThe dotted path of the block-mapping keys that own the link (parent.child), or null in the body or when no key owns it. A key inside a flow mapping (a: { b: "[[x]]" }) is not part of the path.
isInFrontmatterbooleanWhether the link is in the note's frontmatter.
linenumberThe zero-based line holding the link. It differs from the looked-up line only when the cursor was on a frontmatter key whose single link sits on a following line.
linkPathstringThe link path without its subpath: note for [[note#Heading]], the whole url for an external link, and an empty string for a link into the same note ([[#Heading]]).
parseLinkResultParseLinkResultThe parsed link, its offsets being columns on line. Its flags tell the kind of link: a wikilink, an embed, an external link.
rangeEndChnumberThe column just past the range a position hits the link in. In the frontmatter the range takes in the quotes around the link, so it can be wider than the link itself.
rangeStartChnumberThe first column of the range a position hits the link in.
startChnumberThe column the link's raw text starts at on line.
subpathstringThe subpath with its # (#Heading, #^block), or an empty string.

Links to this page: