Skip to content

zjy4fun/streamdown-demo

Repository files navigation

Streamdown Malformed Markdown Lab

A small React + Vite demo built with Streamdown to test how well it renders intentionally messy, not-quite-standard Markdown.

What this demo shows

  • Left pane: editable Markdown input
  • Right pane: live Streamdown render
  • Header button: simulates token-by-token / chunk-by-chunk streaming on the preview side
  • Built-in fake samples for malformed Markdown cases

Included fake malformed cases

  1. Adjacent emphasis

    • Examples like 紧贴中文**加粗**也应该正常显示
    • English words glued to emphasis markers like English**bold**text
  2. Unclosed formatting

    • Unfinished bold or italic markers such as **这个加粗没有闭合
    • Half-finished list content from streaming output
  3. Partial code fence

    • An opened but unclosed fenced code block
    • Useful for checking Streamdown's incomplete-markdown rendering behavior

Run locally

npm install
npm run dev

Open the local Vite URL in your browser.

Test and verify

npm run test
npm run build
npm run lint

Notes

  • The demo uses parseIncompleteMarkdown so broken or partial Markdown can still render progressively.
  • The simulated streaming button progressively reveals the current textarea content on the preview side.
  • Streamdown successfully handles the adjacent-emphasis examples in this demo, including cases where bold markers touch Chinese text or English words without surrounding spaces.

About

A Streamdown demo for malformed Markdown rendering and simulated streaming playback

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors