json-schema-org / json-schema-org/website
🐛 Bug: React rendering crash in `StyledMarkdownBlock` for single-child table headers
@h30s is already working on this.
Since Feb 21, 2026.
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
Describe the bug
There is a logic flaw in the checkHasContent utility function (lib/markdownUtils.ts) that causes a complete page crash when a Markdown table header has exactly one column.
The function assumes reactNode.props.children is an array and calls .reduce() on it. However, if a component only has one child in React, props.children is an object, not an array. When markdown-to-jsx renders a single-column table, props.children on the <tr> wrapper is a single <th> object. Calling .reduce() on this object throws TypeError: reactNode.props.children.reduce is not a function, crashing the entire page render.
Steps To Reproduce
- Create or edit a markdown file rendered via
StyledMarkdownBlock. - Add a table with only one column:
- Load the page locally or in preview.
- See the
TypeErrorcomplete page crash in the browser console / terminal.
Expected Behavior
The page should render the single-column table correctly without crashing. The utility function should safely iterate React children using React.Children.toArray() or check Array.isArray() before assuming array methods are available.
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.