The published type declarations (dist/index.d.ts) import MermaidConfig
from the mermaid package, making it part of the public API. Having it as
a devDependency meant consumers could end up resolving different mermaid
versions for streamdown and @streamdown/mermaid, causing type errors due
to incompatible MermaidConfig types.
* feat: add lineNumbers prop to disable line numbers in code blocks
* docs: add lineNumbers prop and noLineNumbers meta string
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(streamdown): preserve double newlines in literalTagContent tags
When a tag is in literalTagContent mode, double newlines (\n\n) inside
the tag content were incorrectly treated as paragraph separators by the
markdown parser, causing the content after the first blank line to be
excluded from the tag's children.
Fix: in preprocessLiteralTagContent, after escaping markdown metacharacters,
replace \n\n with HTML entities. This prevents the markdown
parser from interpreting blank lines as paragraph breaks while still
preserving the newline characters (rehype-raw decodes back to \n).
Fixesvercel/streamdown#456
* Run pnpm fix to resolve formatting issues
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix pre-existing formatting issue in code-block/index.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix lint and formatting issues
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix(streamdown-code): fall back to plain text for unknown/truncated language identifiers
When a code block's language identifier is unrecognised by Shiki (e.g.
'rus' from a network-truncated 'rust'), createHighlighter throws a
ShikiError. Previously the .catch() block only logged the error and
left subscribers hanging, causing a permanent React render-cycle stall.
Fix: resolve the language to the 'text' fallback *before* calling
getHighlighter() when the identifier is not in the bundledLanguages
set. This prevents the exception entirely and ensures the code block
renders with plain-text highlighting instead of breaking.
Fixes#433
* Add changeset for unknown language fallback fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add test for unknown/truncated language fallback
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix TypeScript error: widen safeLanguage type to include SpecialLanguage
`'text'` is a SpecialLanguage in Shiki, not a BundledLanguage, so the
type annotations for getHighlighter and getHighlighterCacheKey need to
accept both.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix formatting: remove trailing comma, use double quotes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Custom renderers now receive the raw metastring from code fences via a
new optional `meta` prop. Everything after the language identifier is
passed through (e.g. ```rust {1} title="foo"``` → meta = '{1} title="foo"').
- Added `meta?: string` to `CustomRendererProps` in `plugin-types.ts`
- Pass `meta={metastring}` to custom renderers in `components.tsx`
- Added tests for meta prop presence and absence
- Added minor changeset
Closes#443
Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com>
* fix(save): prepend UTF-8 BOM to CSV blobs for Excel compatibility
Closes#440
* fix(download): refactor TableDownloadButton to use save() for CSV downloads and ensure UTF-8 BOM compatibility