Skip to content

parseLink

Parses a link into its components.

A string that starts with [ and ends with a markdown link is read as ONE link whose caption runs from the leading [ to that link’s ](, the way Obsidian reads a frontmatter value: [A [ B](t.md) has the alias A [ B, where CommonMark finds only [ B](t.md).

Import:

import { parseLink } from '@mnaoumov/obsidian-lib/parse-link';

Signature:

function parseLink($string: string, options: ParseLinksOptions | undefined): ParseLinkResult | null

Parameters:

Parameter Type Description
$string string
options ParseLinksOptions | undefined The parse options.

Returns: ParseLinkResult | null — The parsed link.


Links to this page: