Skip to content

Commit 33e3489

Browse files
authoredJan 18, 2023
Fix to not strip whitespace in th, td
Related-to GH-32. Closes GH-45. Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent 32b5e83 commit 33e3489

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
 

‎lib/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ const tableElements = new Set([
3636
'tbody',
3737
'tfoot',
3838
'tr',
39-
'th',
40-
'td'
4139
])
4240

4341
/**

‎test.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,16 @@ test('React ' + React.version, (t) => {
171171
t.deepEqual(
172172
processor.stringify(
173173
u('root', [
174-
h('table', {}, ['\n ', h('tbody', {}, ['\n ', h('tr', {})])])
174+
h('table', {}, ['\n ', h('tbody', {}, ['\n ', h('tr', {}, ['\n ', h('th', {}, ['\n ']), h('td', {}, ['\n '])])])])
175175
])
176176
),
177177
React.createElement('div', {}, [
178178
React.createElement('table', {key: 'h-1'}, [
179179
React.createElement('tbody', {key: 'h-2'}, [
180-
React.createElement('tr', {key: 'h-3'}, undefined)
180+
React.createElement('tr', {key: 'h-3'}, [
181+
React.createElement('th', {key: 'h-4'}, ['\n ']),
182+
React.createElement('td', {key: 'h-5'}, ['\n ']),
183+
])
181184
])
182185
])
183186
]),

0 commit comments

Comments
 (0)
Please sign in to comment.