Repository navigation
fix(mrml-core): forward layout context through mj-include - #696
Merged
Merged
Conversation
Signed-off-by: Jeremie Drouet <jeremie.drouet@gmail.com>
Contributor
|
📈 This is how your metrics evolved 📉 |
Open
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.
Content pulled in through
mj-includerenders differently from the same content written inline.The include renderer forwarded only
indexandsiblingsto its children, so the comment was counted as a layout sibling and the column rendered at half width. It also never implementedset_container_width, so the width never reached the children at all — an<mj-image>inside an included fragment came out with nowidthattribute and no width on its wrapping<td>.Both now match the inlined form:
mj-column-per-100, andwidth="550"on the image.raw_siblingsis computed the waymj_sectioncomputes it for its own children — a count of raw children over the child list — rather than the waymj_rawdoes it. Inmj_rawevery child is raw soraw_siblings == siblings, but an included fragment holds a mix, and copying that would have been wrong.Two regression tests comparing included against inlined output with
html_compare::assert_similar, both confirmed failing before the change (expected.mj-column-per-100, got.mj-column-per-50; and the missing image width) and passing after. No golden fixture usesmj-include, so the full suite passing is also a clean check that non-include templates are untouched.Tests 621 -> 623.
Follow-up, deliberately not in here: a section still treats an entire included fragment as one opaque non-raw child, so it emits a single Outlook conditional
<td>around the whole include instead of one per column. Fixing that needs the section's child iteration to flatten includes, which is a bigger change than this one.