Reviewed-by: Titus Wormer <tituswormer@gmail.com>
Related-to GH-28. Related-to GH-29. Closes GH-32.
26 | 26 | import {toH} from 'hast-to-hyperscript' |
|
27 | 27 | // @ts-expect-error: hush. |
|
28 | 28 | import tableCellStyle from '@mapbox/hast-util-table-cell-style' |
|
29 | + | import {whitespace} from 'hast-util-whitespace' |
|
29 | 30 | ||
30 | 31 | const own = {}.hasOwnProperty |
|
31 | 32 | const tableElements = new Set([ |
90 | 91 | // See: <https://github.com/facebook/react/pull/7515>. |
|
91 | 92 | // See: <https://github.com/remarkjs/remark-react/issues/64>. |
|
92 | 93 | if (children && tableElements.has(name)) { |
|
93 | - | children = children.filter((child) => child !== '\n') |
|
94 | + | children = children.filter((child) => !whitespace(child)) |
|
94 | 95 | } |
|
95 | 96 | ||
96 | 97 | if (options.components && own.call(options.components, name)) { |
Files | Coverage |
---|---|
index.js | 100.00% |
lib/index.js | 100.00% |
Project Totals (2 files) | 100.00% |