Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jan 18, 2023
1 parent 33e3489 commit 532e059
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 1 addition & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ import tableCellStyle from '@mapbox/hast-util-table-cell-style'
import {whitespace} from 'hast-util-whitespace'

const own = {}.hasOwnProperty
const tableElements = new Set([
'table',
'thead',
'tbody',
'tfoot',
'tr',
])
const tableElements = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr'])

/**
* Compile HTML to React nodes.
Expand Down
10 changes: 8 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,21 @@ test('React ' + React.version, (t) => {
t.deepEqual(
processor.stringify(
u('root', [
h('table', {}, ['\n ', h('tbody', {}, ['\n ', h('tr', {}, ['\n ', h('th', {}, ['\n ']), h('td', {}, ['\n '])])])])
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'}, [
React.createElement('th', {key: 'h-4'}, ['\n ']),
React.createElement('td', {key: 'h-5'}, ['\n ']),
React.createElement('td', {key: 'h-5'}, ['\n '])
])
])
])
Expand Down

0 comments on commit 532e059

Please sign in to comment.