Skip to content

Commit b186995

Browse files
authored
Fix hProperties on tableCell
Closes GH-71. Reviewed-by: Titus Wormer <[email protected]>
1 parent 174c04f commit b186995

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Diff for: lib/handlers/table-row.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function tableRow(state, node, parent) {
5151
if (cell) {
5252
result.children = state.all(cell)
5353
state.patch(cell, result)
54-
result = state.applyData(node, result)
54+
result = state.applyData(cell, result)
5555
}
5656

5757
cells.push(result)

Diff for: test/table.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ test('table', async function (t) {
3030
children: [
3131
{
3232
type: 'tableCell',
33-
children: [{type: 'text', value: 'charlie'}]
33+
children: [{type: 'text', value: 'charlie'}],
34+
data: {
35+
hProperties: {
36+
className: ['foo', 'bar']
37+
}
38+
}
3439
}
3540
]
3641
}
@@ -60,7 +65,7 @@ test('table', async function (t) {
6065
'\n',
6166
h('tr', [
6267
'\n',
63-
h('td', {align: 'left'}, 'charlie'),
68+
h('td', {align: 'left', className: ['foo', ''bar']}, 'charlie'),
6469
'\n',
6570
h('td', {align: 'right'}),
6671
'\n'

0 commit comments

Comments
 (0)