Skip to content

Commit

Permalink
Fix to not strip whitespace in th, td
Browse files Browse the repository at this point in the history
Related-to GH-32.
Closes GH-45.

Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
chitoku-k committed Jan 18, 2023
1 parent 32b5e83 commit 33e3489
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ const tableElements = new Set([
'tbody',
'tfoot',
'tr',
'th',
'td'
])

/**
Expand Down
7 changes: 5 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,16 @@ test('React ' + React.version, (t) => {
t.deepEqual(
processor.stringify(
u('root', [
h('table', {}, ['\n ', h('tbody', {}, ['\n ', h('tr', {})])])
h('table', {}, ['\n ', h('tbody', {}, ['\n ', h('tr', {}, ['\n ', h('th', {}, ['\n ']), h('td', {}, ['\n '])])])])
])
),
React.createElement('div', {}, [
React.createElement('table', {key: 'h-1'}, [
React.createElement('tbody', {key: 'h-2'}, [
React.createElement('tr', {key: 'h-3'}, undefined)
React.createElement('tr', {key: 'h-3'}, [
React.createElement('th', {key: 'h-4'}, ['\n ']),
React.createElement('td', {key: 'h-5'}, ['\n ']),
])
])
])
]),
Expand Down

0 comments on commit 33e3489

Please sign in to comment.