1 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
Remend is a new NPM package that fixes incomplete Markdown syntax during streaming. It automatically detects and completes unterminated Markdown blocks, ensuring proper rendering and layout. This tool can be integrated with any Markdown renderer, enhancing the user experience in real-time applications.
If you do, here's more
Remend is a new npm package designed to handle incomplete Markdown in real-time applications. Previously integrated within Streamdown's Markdown processing, it now operates as a standalone library. It addresses a common issue faced by AI models that generate Markdown token-by-token, which often leads to broken syntax. Problems like unclosed fences, half-finished bold or italic markers, and incomplete links can disrupt rendering and result in raw Markdown being displayed.
The package automatically detects these incomplete Markdown blocks and corrects them, ensuring that the output remains clean and stable throughout a streaming session. For instance, if a stream includes the text "This is **bold text," Remend can complete it to "This is **bold text**" before the closing markers even arrive. It works as a pre-processor with any Markdown renderer, making it versatile for various applications.
Remend has been tested in production environments, particularly within Streamdown, and includes smart rules to avoid incorrect completions. It can handle complex scenarios, such as LaTeX expressions with underscores, product codes with special characters, and nested brackets in links. Developers can start using Remend by installing it via npm, making it easy to integrate into existing projects.
Questions about this article
No questions yet.