Skip to main content

parse_markdown

Function parse_markdown 

Source
pub fn parse_markdown(
    input: &str,
    theme: &Theme,
    width: usize,
) -> Vec<MarkdownLine>
Expand description

Parse markdown into theme-styled lines, each flagged MarkdownLine::preformatted when it must not be word-wrapped — code blocks and tables, whose exact spacing carries meaning (indentation, column alignment). width is the available content width in display cells; tables are sized and wrapped to fit it.

Code-block lines also keep the theme’s code_background on their base style (the gray panel look). Inline code carries the background on the span, not the line, so prose that merely contains code still word-wraps normally.