Skip to content

fix: hold pending streaming markers and preserve empty lists - #633

Open
minwookshin wants to merge 2 commits into
vercel:mainfrom
minwookshin:fix/539-pending-markdown
Open

minwookshin wants to merge 2 commits into
vercel:mainfrom
minwookshin:fix/539-pending-markdown

Conversation

@minwookshin

@minwookshin minwookshin commented Sep 22, 2026 •

Copy link
Copy Markdown

Description

Incomplete inline delimiters such as my name is ** can flash as literal text before the next token. Trimming whitespace from an empty list marker can also turn it into literal text or a setext underline.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Related Issues

Addresses #539.

Changes Made

Add opt-in remend={{ pendingInlineMarkers: true }}. Streamdown enables buffering only while isAnimating is true, so stopping or completing a stream restores legitimate trailing literals. Preserve list-marker whitespace and keep setext protection. Code, math, URLs, escaped syntax and complete markup retain their existing behavior; fenced-code handling uses the shared scanner, including list and blockquote containers.

Before After Why
Pending delimiters flash before content arrives Opted-in streams hold delimiters until interpretable Reduces formatting changes without discarding final literals
Empty list marker loses meaningful whitespace List structure is preserved Avoids a literal dash during streaming

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Manually tested the changes

After updating against main (7dcabc6) on October 29, all six package suites pass: 2,017 tests, including 596 remend and 1,312 Streamdown tests. All six package builds and repository-wide lint/format checks pass. The exact-optional-property type checks also pass. The 44 focused pending-marker cases cover empty list markers and leaving list/blockquote code fences. Earlier browser verification covered pending bold, the first content token, two list items, and flushing final literal **.

The top-level check-types task currently executes no checks, so both affected packages were also checked directly with tsc. Those checks report the same diagnostics as current main with identical dependencies (1 in remend and 210 in Streamdown); no additional diagnostics were introduced. The final GitHub-verified commit has the exact same tree as the locally tested changes.

The rendering regressions exercise successive updates of the same mounted component, including the transition from streaming to finished.

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented the non-obvious parsing constraints
  • I have made corresponding changes to the documentation
  • I have added tests that prove the fix is effective
  • New and existing unit tests pass locally with my changes
  • I have created patch changesets for remend and streamdown

Additional Notes

Buffering is opt-in; existing consumers keep their inline-delimiter behavior. The option is not inferred from input changing, because non-streaming consumers must retain literal trailing syntax.

@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

@minwookshin is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@minwookshin

Copy link
Copy Markdown
Author

Fixed pending-marker handling after closed fences and inside unfinished link/image destinations. All 535 remend tests, the build, and the focused lint check pass.

Use the shared code-region scanner for pending markers and preserve empty-list spacing through both normalization passes.

Validated package builds, lint, and 1,949 tests on the current main.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@minwookshin
minwookshin force-pushed the fix/539-pending-markdown branch from 2fb0e64 to 2fbcf9a Compare September 30, 2026 22:45
@minwookshin

Copy link
Copy Markdown
Author

Updated against main and reused the shared code scanner; fixed the empty-list regression from the final whitespace pass. Package builds, lint, and all 1,949 tests pass; full TypeScript checks match main’s existing diagnostics.

@minwookshin

Copy link
Copy Markdown
Author

Resolved the main conflict and kept the new optional-property types. All 2,017 tests, six package builds, lint and exact-optional type checks pass locally. Full tsc diagnostics match main (1 in remend, 210 in Streamdown). The signed commit matches the tested tree.

Could a maintainer approve the pending CI workflows and Vercel preview?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant