Skip to content

EditLinksInContentParams

Parameters for editLinksInContent.

Import:

import type { EditLinksInContentParams } from 'obsidian-dev-utils/obsidian/link';

Signature:

export interface EditLinksInContentParams

Properties

PropertyTypeDescription
abortSignal?AbortSignalThe abort signal to control the execution of the function.
appAppThe Obsidian application instance.
contentstringThe content to edit the links in.
offsetRange?OffsetRangeA range within EditLinksInContentParams.content, in character offsets, restricting the pass to the links inside it. When omitted, every link is visited.

A link is edited only when it is **fully contained** in the range; one that merely overlaps it is left alone, because rewriting part of a link corrupts it. Both bounds are inclusive, so a range whose offsets coincide exactly with a link's does include that link.

A reference that carries no position within the content — a frontmatter link, a multi-link frontmatter value entry, or any canvas reference — is never in range and is skipped whenever a range is supplied.
shouldEditExternalLinks?booleanWhether to also edit external links parsed from the note body. When true, the converter also receives references for external links.
shouldEditFrontmatterExternalLinks?booleanWhether to also edit external links parsed from frontmatter values. When true, the converter also receives references for frontmatter external links.
shouldEditMultiValueFrontmatterExternalLinks?booleanWhether to also edit external links parsed from multi-link (multi-value) frontmatter values. When true, the converter also receives references for each external link within a multi-link frontmatter value (each located by its offsets, so only that link is spliced back in place).

Methods

MethodReturnsDescription
linkConverter(this, link)Promisable<MaybeReturn<string>>The function that converts each link.

Links to this page: