-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
Bug Description
The inner <table> element incorrectly receives data-streamdown="table-wrapper" instead of data-streamdown="table". This breaks CSS selectors targeting [data-streamdown="table"].
Steps to Reproduce
- Render any markdown with a table using Streamdown
- Inspect the rendered HTML
- Check the
data-streamdownattribute on the<table>element
Expected Behavior
- Wrapper
<div>should havedata-streamdown="table-wrapper" - Inner
<table>should havedata-streamdown="table"
Actual Behavior
- Wrapper
<div>hasdata-streamdown="table-wrapper"✓ - Inner
<table>hasdata-streamdown="table-wrapper"✗ (should betable)
Code Sample
import { Streamdown } from 'streamdown';
const markdown = `
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |
`;
// Rendered output shows <table data-streamdown="table-wrapper"> instead of <table data-streamdown="table">
<Streamdown>{markdown}</Streamdown>Root Cause
In packages/streamdown/lib/components.tsx, MemoTable passes data-streamdown="table-wrapper":
<Table
className={className}
data-streamdown="table-wrapper" // ← passed here
{...props}
>In packages/streamdown/lib/table/index.tsx, this is spread after data-streamdown="table":
<table
data-streamdown="table"
{...props} // ← overwrites with "table-wrapper"
>Streamdown Version
1.6.10
React Version
18.3.1
Node.js Version
20.x
Browser(s)
Chrome
Operating System
macOS
Additional Context
Suggested fix: Remove data-streamdown="table-wrapper" from MemoTable in components.tsx, since the Table component already sets this on its wrapper div.
andreastande
Metadata
Metadata
Assignees
Labels
No labels