Menu

New npm package for automatic recovery of broken streaming markdown - Vercel
📰

New npm package for automatic recovery of broken streaming markdown - Vercel

Vercel News·Hayden Bleasel·6 months ago
#UMOUYtGS
#vercel#remend#markdown#import#bold
Reading 0:00
15s threshold

Remend is a new standalone package that brings intelligent incomplete Markdown handling to any application.

Previously part of Streamdown 's Markdown termination logic, Remend is now a standalone library ( npm i remend ) you can use in any application.

Link to heading Why it matters

AI models stream Markdown token-by-token, which often produces incomplete syntax that breaks rendering. For example:

Unclosed fences

Half-finished bold/italic markers

Unterminated links or lists

Without correction, these patterns fail to render, leak raw Markdown, or disrupt layout:

**This is bold text

[Click here](https://exampl

`const foo = "bar

Remend automatically detects and completes unterminated Markdown blocks, ensuring clean, stable output during streaming.

import remend from "remend" ;

const partialMarkdown = "This is **bold text" ;

const completed = remend ( partialMarkdown ) ;

// Result: "This is **bold text**"

As the stream continues and the actual closing markers arrive, the content seamlessly…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.