obsidian/parse-link
This module provides utilities for parsing markdown and wiki links into structured data, and for escaping, unescaping, and encoding link components.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| ParseFrontmatterLinksResult | The result of parsing the links from a note’s frontmatter via parseFrontmatterLinks. Internal single-link frontmatter values are omitted, as Obsidian natively caches them. |
| ParseLinkFrontmatterReference | A FrontmatterLinkCache for a link parsed from a single-link frontmatter value via parseLinks. It carries the full ParseLinkResult so consumers can inspect the parse details without re-parsing the link. Use this when the whole frontmatter value is a single link. |
| ParseLinkFrontmatterReferenceWithOffsets | A ParseLinkFrontmatterReference for a link parsed from a multi-link frontmatter value via parseLinks, additionally carrying the offsets of the link within the frontmatter value. Use this when the frontmatter value holds multiple links. |
| ParseLinkReference | A ReferenceCache for a link parsed from content via parseLinks. It carries the full ParseLinkResult so consumers can inspect the parse details without re-parsing the link. |
| ParseLinkResult | A result of parsing a link. |
| ToParseLinkReferenceParams | Params for toParseLinkReference. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| encodeUrl | Encodes a URL. |
| escapeAlias | Escapes the alias of a markdown link. |
| isParseLinkFrontmatterReference | Determines whether a reference is a ParseLinkFrontmatterReference. |
| isParseLinkReference | Determines whether a reference is a ParseLinkReference. |
| parseFrontmatterLinks | Parses the links from a note’s frontmatter. Each string value is parsed via parseLinks: a value that is a single link yields an entry without offsets, and a value that holds multiple links yields offset-carrying entries. Internal single-link values are omitted, as Obsidian natively caches them. |
| parseLink | Parses a link into its components. |
| parseLinks | Parses all links in a string. |
| toParseLinkReference | Wraps a ParseLinkResult into a ParseLinkReference so it can flow through the reference-based file-change pipeline. |
| unescapeAlias | Unescapes the alias of a markdown link. |