Expand description
Inline-markdown renderer for assistant messages.
Handles the constructs that come up most in LLM responses:
- bold (
**...**) - italic / italic (
*...*,_..._) - inline
code(`...`) - line-level heading (
#,##, …) - fenced code block with syntax highlighting via
syntect - simple bullet (
-/*) - Markdown table (
|col1|col2|+|---|---|)
Public entry points:
render_inline— single-line inline markdown →Vec<Span<'static>>render_table— slice of table-row lines →Vec<Line<'static>>
Structs§
- MdState
- State carried across consecutive lines so fenced code blocks can span multiple lines.
- Rendered
Line - Result of rendering a single line.
Functions§
- is_
table_ line - Returns
truewhen the line should be treated as part of a Markdown table (starts with|after optional whitespace, or contains|). - render_
inline - Render one logical line of markdown-ish text into styled spans.
- render_
markdown - Parse
textas Markdown and return ratatuiLines for display. - render_
table - Render a Markdown table (sequence of
|...|lines, including the optional|---|---|separator row) into a set of styledLines.