Skip to main content

parse_markdown

Function parse_markdown 

Source
pub fn parse_markdown(
    source_text: &str,
    source_path: Option<String>,
) -> Result<ParsedMarkdown, MarkdownParseError>
Expand description

Split ManT’s optional leading tldr preface from the Markdown document.

Invisible HTML comments delimit the preface so CommonMark renderers can present the enclosed tldr-pages Markdown without leaking extension syntax. It must be the first non-empty construct. The remaining source is parsed independently, so its first H1 remains document metadata rather than part of the preface.

§Errors

Returns MarkdownParseError for an unterminated preface or malformed embedded tldr page.