Skip to content

Commit

Permalink
Fix hProperties on tableCell
Browse files Browse the repository at this point in the history
Closes GH-71.

Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
kanemu authored Aug 28, 2023
1 parent 174c04f commit b186995
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/handlers/table-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions test/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
}
}
]
}
Expand Down Expand Up @@ -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'),

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / lts/gallium

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / lts/gallium

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / lts/gallium

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / lts/gallium

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / lts/gallium

Unterminated string literal.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / node

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / node

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / node

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / node

',' expected.

Check failure on line 68 in test/table.js

View workflow job for this annotation

GitHub Actions / node

Unterminated string literal.
'\n',

Check failure on line 69 in test/table.js

View workflow job for this annotation

GitHub Actions / lts/gallium

',' expected.

Check failure on line 69 in test/table.js

View workflow job for this annotation

GitHub Actions / node

',' expected.
h('td', {align: 'right'}),
'\n'
Expand Down

0 comments on commit b186995

Please sign in to comment.