Repository navigation
brookmd 0.30.1 — No more React nesting warnings on tables
No more React nesting warnings on tables. A React-only fix; brookmd-core
stays at 0.27.0 and the wire contract is unchanged.
Fixed
- Whitespace text under table structure. The core serializes tables one
tag per line (<table>\n<thead>\n<tr>\n…). When a table went through the
React element walker — anyurlTransform, tag-levelcomponentsoverride,
ordecorators, andbrookmd/server/reactwithcomponents— those newlines became text
children of<table>/<thead>/<tbody>/<tfoot>/<tr>, which React
rejects (validateDOMNesting: Whitespace text nodes cannot appear as a child of <tr>). The walker now drops text that is purely ASCII HTML
whitespace when its direct parent is one of those tags or<colgroup>.
Cell content,<pre>/<code>inside cells, non-breaking and other
Unicode spaces, and non-whitespace stray text are all kept, and
parseTrustedHtmlstill returns every text node. Plain rendering (no
transforms), streaming tables withblockData, and the DOM, element, Vue,
Svelte and Solid renderers were never affected. React Native already
filtered these nodes. Thanks to @ethanfann for the report and the fix.