Merged
Conversation
Contributor
|
@timneutkens is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
awesome, plays nicely with our recent similar fix 🚢 |
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.
Description
Fix nested HTML block parsing in
parseMarkdownIntoBlockswhere nested elements of the same type (e.g.<details>inside<details>) would prematurely close the outer block, causing inner content to leak out as separate top-level blocks.Type of Change
Related Issues
Changes Made
parseMarkdownIntoBlocksinlib/parse-blocks.tsxto count both opening and closing tags of the tracked type when merging tokens inside an HTML block, instead of only checking for the first closing tagnested-details-tables.test.tsxwith 5 focused tests covering the nested HTML block parsing bugTesting
Test Coverage
parseMarkdownIntoBlocksproduces balanced open/close counts for 2-deep and 3-deep nesting<details>inside outer<details></details>stays inside the outer<details><details>is produced for a fully nested structureScreenshots/Demos
Using the Next.js stats action markdown:
Before
After
Checklist
pnpm changeset)Changeset
Additional Notes
Root cause: When merging tokens inside an HTML block, the code only checked for closing tags but never tracked new opening tags of the same type. A single nested
</details>would pop the only entry on the HTML tracking stack, so the parser treated the outer block as closed and everything after became separate blocks.