resolveSubpath
Official
Resolve the given subpath to a reference in the obsidian#MetadataCache.
Import:
import { resolveSubpath } from 'obsidian';Example:
console.log(resolveSubpath(cache, '#foo'));Signature:
function resolveSubpath(cache: CachedMetadata, subpath: string): BlockSubpathResult | FootnoteSubpathResult | HeadingSubpathResult | nullParameters:
| Parameter | Type | Description |
|---|---|---|
cache | CachedMetadata | The cached metadata to resolve the subpath in. |
subpath | string | The subpath to resolve. |
Returns: BlockSubpathResult | FootnoteSubpathResult | HeadingSubpathResult | null — The resolved subpath or null if the subpath is not found.
Example:
console.log(resolveSubpath(cache, '#foo'));Links to this page: