Skip to content

ConvertLinkParams

Params for convertLink.

Import:

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

Signature:

export interface ConvertLinkParams

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?LinkStyleA style of the link.
newSourcePathOrFilePathOrFileA source file containing the link.
oldSourcePathOrFile?PathOrFileAn old path of the link.
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: