Render inner blocks when wrapper markup is null#15
Merged
Conversation
- Removed type: module from package.json - Fixes MODULE_NOT_FOUND error in Next.js builds - Maintains ESM output via Babel configuration
- Removed modules:false from Babel preset-env to generate CommonJS - Removed .js extensions from imports (not needed for CommonJS) - Fixes SyntaxError on Vercel while maintaining localhost compatibility - Removed type:module declaration (using CommonJS now)
A block that contains only inner blocks with no surrounding HTML serializes to innerContent === [null, null]. The wrapper template interpolated those nulls directly, producing the literal string "null[innerBlocks]null". That no longer matched the "[innerBlocks]" marker, so it rendered as visible text on the page and the inner blocks were dropped entirely. Null-coalesce the leading and trailing wrapper segments to empty strings so the marker is preserved and the inner blocks render. Add a regression test that fails on the old behavior (leaked "null" text) and passes with the fix.
# Conflicts: # package.json
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.
Summary
null[innerBlocks]nulland dropping their children.Why
innerContentas[null, null]. The wrapper template interpolated thosenulls directly, producing the string"null[innerBlocks]null". That no longer matched the[innerBlocks]marker, so it was emitted as visible text and the inner blocks never rendered. Observed on the sikt.no/arrangementerpage.Notes
[innerBlocks]marker.nulltext) and passes with the fix; full suite is 31/31.main; merging this PR reconcilesmainwith the published release line.