/** * @file * * A small regex-based markdown parser that builds the `CachedMetadata` the `MetadataCache` mock serves: frontmatter, * headings, tags, links, embeds, list items, sections, footnotes and link reference definitions. */ import type { CachedMetadata } from 'obsidian'; /** * Parses markdown content into a `CachedMetadata` object. * * This approximates Obsidian's parser rather than reproducing it: tags, links and embeds are found by regular * expressions outside fenced code blocks and inline code spans, and the blocks between the recognized sections are read * by a port of the block tokenizers Obsidian's metadata worker runs (see `markdown-gap-blocks.ts`). * * Obsidian takes `\r\n`, `\n` and a lone `\r` as one line break each, and reports every position in the original text, * with a line ending before its `\r`. So a note holding a `\r` is parsed with its line breaks turned into `\n`, which * keeps every line and every column, and each position is then moved to the same line and column of the original. * * @param content - The note's full text, frontmatter included. * @returns The metadata, with each collection present only when it is non-empty. */ export declare function parseMarkdownContent(content: string): CachedMetadata;