Skip to content

UpdateLinkParams

Params for updateLink.

Import:

import type { UpdateLinkParams } from '@mnaoumov/obsidian-lib/link';

Signature:

export interface UpdateLinkParams

Properties

PropertyTypeDescription
appAppAn Obsidian app instance.
isEmptyEmbedAliasAllowed?booleanWhether to allow an empty alias for embeds.

Applicable only if the result link style is LinkStyle.Markdown.

If true: ![](foo.png).

If false: ![foo](foo.png).
linkReferenceA reference for the link.
linkPathStyle?LinkPathStyleA style of the link path.
linkStyle?LinkStyleWhether to force markdown links.
newSourcePathOrFilePathOrFileA source file containing the link.
newTargetPathOrFilePathOrFileA file associated with the link.
oldSourcePathOrFile?PathOrFileAn old source file containing the link.
oldTargetPathOrFile?PathOrFileAn old path of the file.
shouldEscapeAlias?booleanWhether to escape the alias.

Applicable only if the result link style is LinkStyle.Markdown.

If true: [\*\*alias\*\*](link.md).

If false: [**alias**](link.md).
shouldIncludeAttachmentExtensionToEmbedAlias?booleanWhether to include the attachment extension in the embed alias.

Applicable only if isEmptyEmbedAliasAllowed is false.

If true: [foo.png](foo.png).

If false: [foo](foo.png).
shouldUpdateFileNameAlias?booleanWhether to update file name alias.
shouldUseAngleBrackets?booleanIndicates if the link should use angle brackets.

Applicable only if linkStyle is LinkStyle.Markdown.

If true: [alias](<path with spaces.md>).

If false: [alias](path%20with%20spaces.md).
shouldUseLeadingDotForRelativePaths?booleanIndicates if the link should use a leading dot.

Applicable only if linkPathStyle is LinkPathStyle.RelativePathToTheSource.

If true: [[./relative/path/to/target]]

If false: [[relative/path/to/target]]
shouldUseLeadingSlashForAbsolutePaths?booleanIndicates if the link should use a leading slash.

Applicable only if linkPathStyle is LinkPathStyle.AbsolutePathInVault.

If true: [[/absolute/path/to/target]]

If false: [[absolute/path/to/target]]

Links to this page: