Feature Request: `@streamdown/ascii` plugin for agent-generated flowcharts & diagrams
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 302
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 14
Description
Problem Statement
Unless explicitly instructed to generate Mermaid, LLMs and coding agents (Claude, Gemini, Codex) overwhelmingly default to ASCII and Unicode box-drawing characters (┌─┐, │ │, └─┘, ──►) for architecture diagrams and flowcharts.
In web markdown renderers, these diagrams often break:
- Font ligatures collapse ASCII sequences (e.g.,
-->turning into stylized arrows, breaking column grids). - Line-by-line span wrappers or syntax highlighters disrupt vertical alignment.
- Standard web monospace fonts often lack uniform box-drawing character advances, causing boxes to misalign.
Proposed Solution
An official @streamdown/ascii plugin (or first-party renderers preset) tailored for agent-generated ASCII diagrams:
- Binds to fences like
```ascii,```diagram,```chart, or plain text diagrams. - Renders preformatted blocks with
font-variant-ligatures: none,whitespace-pre, and an advance-consistent monospace font stack. - Keeps ASCII content as an unbroken text node during streaming to prevent row reflows.
Use Case
import { Streamdown } from "streamdown";
import { ascii } from "@streamdown/ascii";
<Streamdown plugins={{ ascii }}>
{agentOutputWithAsciiDiagram}
</Streamdown>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Streamdown component and its plugins prop shown in the issue, then trace how fenced markdown blocks are rendered during streaming. Define the plugin or renderers preset around the listed ASCII, diagram, and chart fences, and verify that diagrams remain aligned and unbroken while streaming.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100