@generative-dom/plugin-markdown-table
v0.1.0
Published
Generative DOM plugin — pipe tables with streaming support
Downloads
86
Maintainers
Readme
@generative-dom/plugin-markdown-table
GFM-style pipe table plugin for Generative DOM with native streaming support.
Installation
pnpm add @generative-dom/plugin-markdown-tableUsage
import { GenerativeDom } from '@generative-dom/core';
import { markdownTable } from '@generative-dom/plugin-markdown-table';
const md = new GenerativeDom({ container, plugins: [markdownTable()] });Matching
Recognizes pipe-delimited tables with a header, separator, and body rows:
| Name | Age | Role |
|-------|-----|-----------|
| Alice | 30 | Engineer |
| Bob | 25 | Designer |Alignment via colons in the separator: :--- left, :---: center, ---: right.
Streaming
During streaming, partial tables render immediately:
- Header + separator received: renders
<table>with<thead>only - Each new row chunk: appends
<tr>to<tbody> - Incomplete trailing row: held back until newline arrives
Configuration
- priority: 100 (block-level)
- level: block
- matchDescriptor:
{ startChars: '|', requiresSOL: true } - allowedChildren:
['markdown-inline', 'markdown-link']
Rendered Output
<table>
<thead>
<tr><th>Name</th><th>Age</th></tr>
</thead>
<tbody>
<tr><td>Alice</td><td>30</td></tr>
</tbody>
</table>Cells support inline formatting: | **bold** | *italic* | renders correctly.
