Repository navigation
fix(php-transformer): keep positioned media out of media-text - #2968
Merged
Merged
Conversation
chubes4
force-pushed
the
fix/issue-2955-blocks-engine
branch
from
October 16, 2026 21:53
4f6f6fe to
becb94a
Compare
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.
Fixes #2955
Root cause
MediaTextPattern::match()accepted any two-column section whose media child holds an image, including a hero whose<figure>isposition:absolute; inset:0behind the copy.core/media-textlays both children out side by side, so the cover image became a full-width in-flow column (1440×900 instead of the source's 613×592 at x=827) and pushed the copy down.The fix: once the media style is resolved, the pattern declines when the media's
positionisabsoluteorfixed, or cannot be resolved. The element then follows the normal group path, which keeps the author's positioning.Tests
tests/unit/media-text-pattern.php: new cases for absolutely positioned media, fixed media, and unchanged in-flow media. The positioned cases fail on trunk and pass with the fix.composer validate --strict && composer testpasses locally.AI disclosure: Claude Opus via Pi coding agent (Homeboy cook + Roadie). A Homeboy cook first patched the TypeScript converter, which the PHP import path does not use. The orchestrating agent discarded that change, wrote this PHP fix and its tests, and ran the full suite. Chris Huber directed the work.