Files
codex/codex-rs/config/src/tui_rendering.rs
T
Eric Traut 5a11c45606 Render TUI Markdown lists with Unicode bullets and checkboxes (#47322)
## What changed

Render unordered bullets as `•` and task markers as `☐` or `☑`, preserving ordered numbering and continuation indentation in streaming and completed Markdown. Add `tui.rendering.lists`, enabled by default; setting it to `false` retains hyphen bullets and textual task markers.

## Testing

Add snapshot coverage for nested, ordered, quoted, and wrapped task lists, plus code and escaped markers. Add character-by-character streaming tests that compare incremental and emitted output with full rendering, with list rendering enabled and disabled.

GitOrigin-RevId: df9209d8c42f277dd2a2d7073ea19a6feb7dd706
2026-09-22 16:34:07 +00:00

32 lines
913 B
Rust

//! TUI content rendering preferences, independent of animation effects.
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
/// Optional rich renderers. Disabled renderers preserve the original source.
#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq, Eq, JsonSchema)]
#[serde(default)]
#[schemars(deny_unknown_fields)]
pub struct TuiRendering {
/// Render Mermaid code blocks as diagrams.
pub mermaid: bool,
/// Render math expressions using Unicode notation.
pub math: bool,
/// Render pipe tables, including tables inside Markdown fences.
pub tables: bool,
/// Render Markdown bullets and task-list markers as Unicode symbols.
pub lists: bool,
}
impl Default for TuiRendering {
fn default() -> Self {
Self {
mermaid: true,
math: true,
tables: true,
lists: true,
}
}
}