# Shared rendering guide
Converts text into semantic display lines; callers own terminal layout and state.
## Where to look
| Input kinds, display spans/roles, dispatch | `mod.rs` |
| Markdown structure | `markup.rs` |
| Syntax-aware code roles | `highlight.rs` |
| Diff line classification | `diff.rs` |
## Local rules
- Return `DisplayLine`/`DisplaySpan` with `DisplayRole`, not terminal colors/backend widgets. Mission Control maps roles to presentation.
- Markdown uses pulldown-cmark events. Code blocks delegate to shared rendering/highlighting, not another embedded highlighter.
- Syntax assets are lazily shared through `OnceLock`. Unknown languages and oversized code use fallback roles.
- Highlighter limits are 400 lines and 64 KiB; these bound highlighting work, not total rendered output.
- Diff rendering classifies text without validating/applying patches. Classify file headers before ordinary added/removed lines.
- Helpers do not enforce general byte limits, redaction or width wrapping. Callers sanitize/bound input and handle terminal layout.