Repository navigation
✨ feat: add remend option to Streamdown - #5
Merged
Merged
Conversation
Pass RemendOptions to the tail completion pass in both the renderer and the smoothing hook. With default options, remend treats a comparison such as p<q as an unfinished HTML tag and drops everything after it until the stream ends; callers that do not render raw HTML can now pass { htmlTags: false }.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying streamdown with
|
| Latest commit: |
6ee66f1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3f1b28c7.streamdown-6nu.pages.dev |
| Branch Preview URL: | https://fix-remend-options.streamdown-6nu.pages.dev |
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Innei
added a commit
to Innei/Lody
that referenced
this pull request
Sep 26, 2026
… a patch @lobehub/streamdown 1.4.0 exposes the remend options (lobehub/streamdown#5), so the streaming renderer passes { htmlTags: false } directly and the pnpm patch is removed. 1.4.0 is excluded from the minimum release age because it was adopted on release day. Refs LodyAI#421 Model: claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The block lexer completes the open tail with
remend(rawTail)using remend's defaults. Its HTML-tag step treats a TeX comparison such asp<qas an unfinished tag and drops everything after it. Because frozen blocks stop at the first point where remend changed the text, the rest of the message stays hidden until the stream ends. Callers that never render raw HTML have no way to turn that step off.Change
remend?: RemendOptionsprop onStreamdown, also accepted byuseSmoothStreamContent. It is passed tocreateBlockLexer(remendOptions)in both places the lexer runs (the renderer and the smoother's complete-prefix scan), and made stable withuseStableValue, so an inline object does not rebuild the lexer on every render.Tests
blockLexer.test.ts: the default truncatesp<q …input;{ htmlTags: false }keeps it intact.Streamdown.test.tsx: the rendered text keeps the content afterp<qwith the option set.pnpm test(197 passed),pnpm type-check,pnpm lint.Downstream: LodyAI/Lody#1002 currently carries a pnpm patch for this and will switch to the prop once released.