LinkAtPosition
The link found at a position by getLinkAtPosition.
Import:
import type { LinkAtPosition } from '@mnaoumov/obsidian-lib/link-at-position';Signature:
export interface LinkAtPositionProperties
| Property | Type | Description |
|---|---|---|
| endCh | number | The column just past the link's raw text on line. |
| frontmatterKey | null | string | The 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. |
| isInFrontmatter | boolean | Whether the link is in the note's frontmatter. |
| line | number | The 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. |
| linkPath | string | The 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]]). |
| parseLinkResult | ParseLinkResult | The parsed link, its offsets being columns on line. Its flags tell the kind of link: a wikilink, an embed, an external link. |
| rangeEndCh | number | The 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. |
| rangeStartCh | number | The first column of the range a position hits the link in. |
| startCh | number | The column the link's raw text starts at on line. |
| subpath | string | The subpath with its # (#Heading, #^block), or an empty string. |
Links to this page: