Skip to main content

Module markdown

Module markdown 

Source

Structs§

MarkdownLine
A parsed markdown line plus whether it is preformatted — i.e. must NOT be word-wrapped by the chat renderer (which collapses runs of whitespace). Code blocks and tables are preformatted: their exact spacing carries meaning (indentation, column alignment). Everything else word-wraps normally.

Functions§

line_hanging_indent
Hanging indent (display cells) for hard-wrapping line: the column where the line’s content begins, so a wrapped list item’s continuation lines align under its text (after the marker) instead of snapping back to the flat message gutter. Counts leading whitespace plus a leading list marker; returns 0 for ordinary paragraphs and headings.
parse_markdown
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.