fix(mdxish): builtin tabs component rendering#1346
Merged
maximilianfalco merged 2 commits intonextfrom Feb 17, 2026
Merged
Conversation
maximilianfalco
approved these changes
Feb 17, 2026
Contributor
maximilianfalco
left a comment
There was a problem hiding this comment.
lgtm! thanks for catching this!
eaglethrost
approved these changes
Feb 17, 2026
Contributor
This PR was released!🚀 Changes included in v13.1.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR addresses issues we found with the
Tabscomponent no longer working with the mdxish renderer.This regression was caused by the
terminateHtmlFlowBlockspreprocessor added here #1336Rendering a Tabs component with mdxish would cause this runtime error:
The
terminateHtmlFlowBlockslogic isn’t accounting for raw html within pascal case JSX tags and just adding line breaks inside the Tabs syntax where there definitely shouldn’t be. Which in turn is mangling the AST we’d expect for the tabs component and breaks the Tabs node children into separate AST nodes with a mix of Tab element nodes, raw html nodes, whitespace nodes instead of a set of Tab nodes. When this gets rendered to React,children?.map(tab => tab.props.title)crashes because non Tab child nodes don’t have propsIn trying to fix this I discovered we didn't have any unit test coverage for the
Tabscomponent in the repo (for but mdx and mdxish).🧰 Changes
Tabscomponent rendering for mdxish at__tests__/lib/render-mdxish/Tabs.test.tsxTabscomponent rendering fixes:I tried to keep the blast radius of the changes scoped to
terminateHtmlFlowBlocksbut adding test coverage to__tests__/lib/render-mdxish/Tabs.test.tsxuncovered that wasn't causing some root issues. So here's the smallest change set I was able to come up with:mdxish-component-blocks.tsWhen a closing tag is embedded in the middle of an HTML sibling (not at the end), content after the closing tag was being lost. This prevented sequential sibling components from being processed.mdxish-components.tsThe markdown parser wraps inline content in<p>tags, but when that content is actually component children (e.g.,<Tab>inside<Tabs>), the<p>wrapper needs to be removed so components appear as direct children.🧬 QA & Testing
This markdown should render correctly with the mdxish renderer: