diff --git a/lib/handlers/table-row.js b/lib/handlers/table-row.js index 5c2f0e1..4546f02 100644 --- a/lib/handlers/table-row.js +++ b/lib/handlers/table-row.js @@ -51,7 +51,7 @@ export function tableRow(state, node, parent) { if (cell) { result.children = state.all(cell) state.patch(cell, result) - result = state.applyData(node, result) + result = state.applyData(cell, result) } cells.push(result) diff --git a/test/table.js b/test/table.js index 3e4f537..2e32308 100644 --- a/test/table.js +++ b/test/table.js @@ -30,7 +30,12 @@ test('table', async function (t) { children: [ { type: 'tableCell', - children: [{type: 'text', value: 'charlie'}] + children: [{type: 'text', value: 'charlie'}], + data: { + hProperties: { + className: ['foo', 'bar'] + } + } } ] } @@ -60,7 +65,7 @@ test('table', async function (t) { '\n', h('tr', [ '\n', - h('td', {align: 'left'}, 'charlie'), + h('td', {align: 'left', className: ['foo', ''bar']}, 'charlie'), '\n', h('td', {align: 'right'}), '\n'