Streaming response
The model can send ordinary Markdown as it thinks.
- completed blocks stay stable
- unfinished markers stay out of the way
- React and HTML stay in sync
const text = responseSoFar
return render(text)Unsafe links stay text-only
Markdown with an exit strategy.
Parse documents or accumulated AI output into a plain, serializable tree. Inspect it, cache it, index it, or render it as HTML, React, or Octane.
---
title: Ship the docs
---
# One source
Parse it **once**. Render it where the product needs it.
- cache the tree
- index the text
- choose a rendererParsing does not trap content inside a renderer. Edit the source and inspect the serializable tree, deterministic HTML, or React output.
{
"type": "root",
"frontmatter": "title: Durable content",
"children": [
{
"type": "heading",
"depth": 1,
"id": "one-source-many-destinations",
"children": [
{
"type": "text",
"value": "One source, many destinations"
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Parse the document "
},
{
"type": "strong",
"children": [
{
"type": "text",
"value": "once"
}
]
},
{
"type": "text",
"value": ", then keep the tree."
}
]
},
{
"type": "list",
"ordered": false,
"items": [
{
"type": "listItem",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "cache it at the edge"
}
]
}
]
},
{
"type": "listItem",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "index its text"
}
]
}
]
},
{
"type": "listItem",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "render it with React or HTML"
}
]
}
]
}
]
},
{
"type": "blockquote",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "The renderer can change. The document does not."
}
]
}
]
}
]
}Append each chunk and pass the complete string through Markdown. The optional streaming profile reparses synchronously, with no incremental state to coordinate or recover.
# Streaming response
The model can send **ordinary Markdown** as it thinks.
- completed blocks stay stable
- unfinished markers stay out of the way
- React and HTML stay in sync
```ts
const text = responseSoFar
return render(text)
```
[Unsafe links stay text-only](javascript:alert("nope"))The model can send ordinary Markdown as it thinks.
const text = responseSoFar
return render(text)Unsafe links stay text-only
Technical docs need a known vocabulary, not an open-ended compiler platform. New syntax has to justify its bytes, ambiguity, and maintenance cost.
Markdown source renders with raw HTML escaped and unsafe link and image URLs removed by default. Custom ASTs, highlighters, and HTML hooks are trusted application inputs.
<script>alert("not today")</script>
[Run code](javascript:alert("nope"))
**Trusted Markdown still renders.**<p><script>alert("not today")</script></p>
<p>Run code</p>
<p><strong>Trusted Markdown still renders.</strong></p>Split entry points keep the parser, renderers, framework adapters, and docs extensions independent. Import only the layer the page needs.
Gzip sizes for minified browser bundles. Renderers include the parser; framework runtimes and highlighters are excluded. Feature sets differ. Measurement details
Code fences store language and metadata in the AST. Supply a highlighter callback to render escaped token markup inside Markdown's code containers.
Companion, not dependency
Synchronous highlighting for the code fences the document model already understands.
Explore HighlightSponsors get special perks like private discord channels, priority issue requests, and direct support!