Commit Graph

129 Commits

Author SHA1 Message Date
streamdown-github-app[bot] dc5bd12e57 Version Packages (#166)
Co-authored-by: streamdown-bot[bot] <streamdown-bot[bot]@users.noreply.github.com>
2025-10-10 11:32:45 -07:00
Hayden Bleasel 0bfca42774 1.4 fixes (#180)
* Run Ultracite

* Remove test logging

* Fix props passthrough

* Update index.tsx

* Remove bad tests

* Improve mermaid tests

* Create funny-moments-jump.md
2025-10-10 11:28:45 -07:00
Hayden Bleasel 3c780b4827 fix: footnotes are blocked by default (#179)
* Update rehype-harden

* Fix footnotes rendering

* Update footnotes.test.tsx

* Create tender-readers-shave.md
2025-10-10 11:04:50 -07:00
Hayden Bleasel 699622fd51 Allow base64 images (#175)
* Update index.tsx

* Create ripe-stars-jam.md

* Bump rehype-harden

* Update pnpm-lock.yaml
2025-10-10 10:11:09 -07:00
Hayden Bleasel 6c0672b1e9 Fix footnotes (#174)
* Fix footnotes in markdown parsing

* Create footnotes.test.tsx

* Create light-beers-peel.md

* Bump rehype-harden

* Update gfm.tsx

* Update parse-blocks.tsx

* Update pnpm-lock.yaml
2025-10-10 10:08:51 -07:00
Hayden Bleasel f5d6cd6668 Remove options props, make plugins fully customizable (#177)
* Remove options props, make plugins fully customizable

* Update docs

* Create puny-turkeys-press.md

* Remove harden options

* Make defaults easily overridable

* Simplify keys

* Update hardened.tsx

* Remove unused unit tests

* Add missing props
2025-10-10 09:39:40 -07:00
Hayden Bleasel 21a7031bd5 fix: streamdown doesnt render background for code blocks (#176)
* Restore original themed backgrounds

* Create stupid-plants-cross.md
2025-10-09 19:17:53 -07:00
Hayden Bleasel d0444a38f2 Add isStreaming prop (#173)
* Add support for isAnimating

* Update props

* Update code-block.test.tsx

* Update useChat implementation code

* Create all-queens-follow.md
2025-10-09 18:26:51 -07:00
Hayden Bleasel 04f6f3aaba fix: hydration error while rendering image (#172)
* Extract images from paragraph tags

* Create image-hydration.test.tsx

* Create tangy-taxis-hammer.md

* Fix linting and formatting commands
2025-10-09 17:22:40 -07:00
Hayden Bleasel 7cd5048e21 Add support for remarkMathOptions and remarkGfmOptions props (#171)
* Add support for remarkMathOptions and remarkGfmOptions props

* Create remark-options.test.tsx

* Create odd-falcons-heal.md

* Add to website
2025-10-09 17:15:45 -07:00
Hayden Bleasel 6c6f507e21 Replace harden-react-markdown with rehype-harden (#170)
* replace harden-react-markdown with rehype-harden

* Improve docs

* Add hardenOptions prop to allow for full props

* Improve unit tests for hardenOptions

* Create cute-deer-cut.md

* Update hardened.tsx
2025-10-09 17:02:04 -07:00
Hayden Bleasel 20ca02db5c 160 email addresses rendered as blocked link (#169)
* Update harden-react-markdown and add unit tests

* Create three-candles-create.md
2025-10-09 16:05:53 -07:00
Hayden Bleasel 239e41db4d fix: Block-level Markdown escapes <details> containers when paragraphs/blank lines are present (#168)
* fix block-level markdown escaping details container

* Create new-pants-leave.md
2025-10-09 15:24:27 -07:00
Hayden Bleasel c68ebd6a33 165 support incomplete url parsing for links (#167)
* Replace the URLs of unterminated links to prevent clicks

* Create full-mirrors-lead.md
2025-10-09 15:18:44 -07:00
2hu 5cdde417e4 docs: Update rehypePlugins default value in README (#163)
* docs: Update rehypePlugins default value in README

The default value for `rehypePlugins` in the README was updated to include `rehypeRaw`.

* docs: Update rehypePlugins default value in website
2025-10-09 14:07:11 -07:00
Jamie Taylor 38ad1ed7fe Fix: issue with node object being passed to HTML element attributes (#161)
* updated to use htmlProps instead of props & created test for elements

* fix: fixed node objects being passed as HTML attributes.

* fix: fixed node objects being passed as HTML attributes

* Revert name change

* Update slimy-groups-love.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-09 14:05:15 -07:00
Robert Sun 7a7464fe30 fix: pass in remarkRehypeOptions (#148)
* fix: pass in remarkRehypeOptions

* changeset
2025-10-09 13:58:02 -07:00
streamdown-github-app[bot] c0d45ca15a Version Packages (#126)
Co-authored-by: streamdown-bot[bot] <streamdown-bot[bot]@users.noreply.github.com>
2025-09-15 21:02:49 -07:00
Hayden Bleasel f34c039d40 fix: 121 br in markdown tables from gpt oss seem encoded or printed to output (#146)
* Add rehype-raw to allow HTML elements in markdown

* Create angry-crews-beg.md
2025-09-15 20:47:51 -07:00
Hayden Bleasel 0ebf67db1d 1.3 changes (#145)
* Bump deps

* Run Ultracite

* Update code-block.tsx

* Update parse-blocks.tsx

* Create great-pants-trade.md
2025-09-15 20:35:31 -07:00
Francisco Moretti 64b5afa904 feat: memoize components to prevent child re-renders (#45)
* chore(markdown): memoize components to prevent child re-renders

This PR memoizes Markdown components to prevent re-renders in children. I'll include a video.

Start as draft.

Note: This fix doesn't solve `anchor` because of how `hardern-react-markdown` works.

* changeset

* Draft section

* Revert "Draft section"

This reverts commit df4c3aca05.

* fix: remove unused 'node' prop from MemoLi component

* fix imports

* feat: add ImageComponent to components export and update memoization for Markdown elements

- Introduced `ImageComponent` for handling images in Markdown.
- Updated memoization for various Markdown elements to improve performance.
- Cleaned up import statements for consistency.

* fix: update image component to use MemoImg for improved performance

- Replaced `ImageComponent` with `MemoImg` in the components export.
- This change enhances memoization for image handling in Markdown.

* Change streamdown version and memoize components

Updated streamdown version from patch to minor and added feature to memoize components.

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-09-15 13:13:40 -07:00
2hu 20330ba822 feat: add table text/html copy (#130) 2025-09-15 12:12:40 -07:00
Pere Montpeó d29281ed59 fix: update background color in TableDownloadDropdown component (#133)
* fix: update background color in TableDownloadDropdown component

* chore: changeset
2025-09-15 12:10:38 -07:00
Cris 11b347e044 fix: prevent runtime error by falling back for unsupported languages in Shiki (#136)
* fix(code-blocks): unsupported programming languages fallback to plain text

* chore: created a changeset for unsupported languages fallback

* refactor(supported-shiki-languages): removed redundant supported languages type

* revert pnpm-lock.yaml to match upstream/main

* removed extra space

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-09-15 12:09:29 -07:00
Machiel 73b17a4d0b showControls to show and hide copy/download buttons (#138)
* feat: add showControls prop to control copy/download button visibility.

* feat: Add documentation for `showControls`.

* feat: Add tests for `showControls`.

* feat: add showControls prop to control copy/download button visibility.

* Rename showControls to controls

* Fix conditional hooks

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-09-15 12:08:03 -07:00
17hz 333df85cd2 Update moduleResolution in tsconfig.json to bundler (#143)
* Update moduleResolution in tsconfig.json to bundler

* Create lovely-windows-care.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-09-15 12:04:53 -07:00
sunjie21 ecb929abb8 fix: long link text overflows (#139) 2025-09-15 10:38:15 -07:00
2hu d583b1f582 chore: marked tree-shaking(possible) (#116) 2025-09-10 21:13:36 -07:00
Ayhan Sipahi d2edc9012d feat: add custom Mermaid configuration support (#122)
* feat: add custom Mermaid configuration support

* ci: add change set

* fix: optimize mermaid config comparison and initialization
2025-09-10 21:12:25 -07:00
John McCambridge 266fa2be95 Fix/word internal underscores (#125)
* handle case for internal underscore

* fix: word-internal underscores incorrectly treated as incomplete markdown

* chore: remove redundant coverage

* fix: word internal underscores

* fix: handle non-unicode
2025-09-10 21:09:58 -07:00
streamdown-github-app[bot] fc09c5af50 Version Packages (#101)
Co-authored-by: streamdown-bot[bot] <streamdown-bot[bot]@users.noreply.github.com>
2025-09-04 21:52:10 -07:00
Hayden Bleasel 8511d5de18 Update table.tsx 2025-09-04 21:36:57 -07:00
Hayden Bleasel 36ce0b0237 Update table.tsx 2025-09-04 21:35:37 -07:00
Hayden Bleasel c3a2eaaca7 V1.2 misc fixes (#105)
* Add type safety to remark plugins

* Move harden-react-markdown defaults to props

* Change switch to if to avoid default clause

* Use save-file for table

* Use for-of

* Write custom save function

* Remove use of state in image

* Update image.tsx

* Use existing save function

* Create khaki-facts-fly.md
2025-09-04 21:25:45 -07:00
Hayden Bleasel fa7733c918 1.2 cleanup (#104)
* Bump deps

* Run Ultracite

* Replace custom download code with file-saver

* Export with correct file extension

* Update code-block.tsx

* Replace file-saver with save-file

* Add button animations

* Add file support to test app

* Add ability to select model in test app

* Filter out embedding models

* Update chat.tsx

* Create olive-lamps-glow.md
2025-09-04 19:00:25 -07:00
Milind Mishra a4a10fcd8d feat: add image download functionality with hover controls (#103)
* feat: add image download functionality

* feat: add changeset

* fix: misc nitpicks
2025-09-04 17:38:25 -07:00
Milind Mishra 435a2c6230 feat: add download functionality to code blocks (#102)
* feat: add code block download capablity

* feat: add change set
2025-09-04 17:29:17 -07:00
Hayden Bleasel bc3f423353 fix: parseincompletemarkdown lists emphasis character block issue (#100)
* handle lists with emphasis character blocks

* Create good-maps-sneeze.md

* Update components.test.tsx
2025-09-04 15:31:20 -07:00
Milind Mishra 3fab433c28 feat: add table markdown copy and csv/markdown download options (#99)
* feat: add table markdown copy and csv and markdown download options

* fix: update table copy button title to lowercase

* Update packages/streamdown/lib/table.tsx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update packages/streamdown/lib/table.tsx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* feat: nitpicks

* feat: add changeset

* fix: address table copy event handler nitpicks

* Update packages/streamdown/lib/table.tsx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-09-04 14:34:22 -07:00
streamdown-github-app[bot] f264e984e3 Version Packages (#93)
Co-authored-by: streamdown-bot[bot] <streamdown-bot[bot]@users.noreply.github.com>
2025-09-03 15:46:21 -07:00
Hayden Bleasel 426c8970ee fix: parseincompletemarkdown emphasis character block issue (#94)
* Handle trailing markdown

* Fix nested italics

* Create old-facts-beg.md
2025-09-03 15:27:19 -07:00
Taesu 4459b14a5d feat: adjust table component (#92)
* feat: apply whitespace-nowrap to th and match table colors with CodeBlock

* test: update thead/tbody test codes

* chore: add changeset for table component update

* test: adjust th test code
2025-09-03 14:41:53 -07:00
streamdown-github-app[bot] 7a128a2701 Version Packages (#87)
Co-authored-by: streamdown-bot[bot] <streamdown-bot[bot]@users.noreply.github.com>
2025-09-03 09:57:11 -07:00
Hayden Bleasel 5a50f22008 Bump deps (#89)
* Bump deps

* Transpile shiki

* Create afraid-kiwis-bathe.md

* Update biome.jsonc

* Ignore shadcn files

* Run Ultracite

* Run unsafe fixes
2025-09-03 09:56:07 -07:00
Hayden Bleasel 4737c9928d fix: streaming lists long items break to a new line once the next token / element arrives (#88)
* Update components.tsx

* Create rotten-ravens-start.md
2025-09-03 09:47:24 -07:00
野迂迂 23d8efe332 fix: resolve onCopy function called multiply times (#86)
* fix: resolve onCopy function called multiply times

* chore: add changeset

* fix: update copied condition
2025-09-03 09:37:08 -07:00
streamdown-github-app[bot] 066e213671 Version Packages (#81)
Co-authored-by: streamdown-bot[bot] <streamdown-bot[bot]@users.noreply.github.com>
2025-09-02 19:43:43 -07:00
Hayden Bleasel f45ea6d7d2 fix: the unterminated long link text is not rendering anything until the full link has completed streaming (#85)
* Update terminator-parser.tsx

* Automatically close links with placeholder url

* Create yummy-lines-matter.md
2025-09-02 19:35:54 -07:00
Hayden Bleasel bda3134b52 add rtl unit tests (#84)
* Create rtl-support.test.tsx

* Create upset-eggs-own.md

* Update rtl-support.test.tsx
2025-09-02 18:26:25 -07:00
Hayden Bleasel 76b68bfa70 fix: more data attributes for code block elements (#82)
* add more code block data attributes

* Create brown-goats-serve.md
2025-09-02 17:46:48 -07:00