Skip to content

Commit b83b0a5

Browse files
rich-text-table-support
1 parent bae8b30 commit b83b0a5

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "@crystallize/reactjs-components",
33
"license": "MIT",
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"author": "Crystallize <[email protected]> (https://crystallize.com)",
66
"contributors": [
77
"Håkon Krogh <[email protected]>",
8-
"Sébastien Morel <[email protected]>"
8+
"Sébastien Morel <[email protected]>",
9+
"Dhairya Dwivedi <[email protected]>"
910
],
1011
"scripts": {
1112
"watch": "tsc -W",

src/content-transformer/component.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,27 @@ export const Renderers: Record<keyof Overrides, (props: NodeProps) => JSX.Elemen
111111
<NodeContent {...props} />
112112
</sup>
113113
),
114-
'horizontal-line': (props) => <hr />,
114+
'horizontal-line': () => <hr />,
115+
table: (props) => (
116+
<table>
117+
<NodeContent {...props} />
118+
</table>
119+
),
120+
'table-row': (props) => (
121+
<tr>
122+
<NodeContent {...props} />
123+
</tr>
124+
),
125+
'table-cell': (props) => (
126+
<td>
127+
<NodeContent {...props} />
128+
</td>
129+
),
130+
'table-head-cell': (props) => (
131+
<th>
132+
<NodeContent {...props} />
133+
</th>
134+
),
115135
};
116136

117137
export interface Props {

src/content-transformer/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ export interface Overrides {
3535
subscripted?: Override;
3636
superscripted?: Override;
3737
'horizontal-line'?: Override;
38+
table?: Override;
39+
'table-row'?: Override;
40+
'table-cell'?: Override;
41+
'table-head-cell'?: Override;
3842
}

0 commit comments

Comments
 (0)