Skip to content

brookmd 0.30.1 — No more React nesting warnings on tables

Choose a tag to compare

@github-actions github-actions released this 15 Sep 13:02
· 3 commits to main since this release

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 — any urlTransform, tag-level components override,
    or decorators, and brookmd/server/react with components — 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
    parseTrustedHtml still returns every text node. Plain rendering (no
    transforms), streaming tables with blockData, 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.