Skip to main content

process_markdown_with_toc

Function process_markdown_with_toc 

Source
pub fn process_markdown_with_toc(
    content: &str,
    options: &MarkdownOptions<'_>,
) -> Result<(String, Vec<Heading>), MarkdownError>
Expand description

Processes Markdown and returns both the rendered HTML and a document-order table of contents.

Each Heading carries the level, the plain-text content, and the anchor id that comrak emits for that heading. To make those ids actually appear in the rendered HTML, set MarkdownOptions::header_ids (the same prefix is reflected in Heading::id).

ยงErrors

Mirrors process_markdown.