Skip to main content

process_markdown_to_writer

Function process_markdown_to_writer 

Source
pub fn process_markdown_to_writer<W: Write>(
    content: &str,
    writer: &mut W,
    options: &MarkdownOptions<'_>,
) -> Result<(), MarkdownError>
Expand description

Streams processed HTML directly to a Write sink.

Semantically equivalent to process_markdown, but avoids one intermediate allocation when callers already have a Write destination (a file, a buffered network writer, a template engine). The comrak render stage still produces a String internally — the 1 MiB default input cap means end-to-end streaming would add API surface without meaningful memory savings.

§Errors

Returns MarkdownError::IoError if the writer fails. All other error conditions mirror process_markdown.