Repository navigation
Render mj-raw children of mj-section and mj-group - #103
Conversation
MJML allows mj-raw inside mj-section and mj-group, but both components rendered only their column children, so raw content was dropped from the output. Raw children now render verbatim in document order, outside the Outlook column cells, as the reference renderer does. They do not count towards column widths. Adds golden fixtures generated with mjml 4.18.0 and component tests for order, widths, raw-only and consecutive raw children. Signed-off-by: Jonathan Putney <jputney@noverant.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Render raw children alongside columns mjml-java-core/src/main/java/.../body/MjGroup.java, mjml-java-core/src/main/java/.../body/MjSection.java, mjml-java-core/src/test/java/.../body/MjGroupTest.java, mjml-java-core/src/test/java/.../body/MjSectionRenderTest.java, mjml-java-core/src/test/resources/golden/raw-in-group.*, mjml-java-core/src/test/resources/golden/raw-in-section.* |
Both renderers emit mj-raw children outside column cells and preserve column sizing and MSO table markup. Tests and golden fixtures cover raw content before, between, and after columns, as well as raw-only children. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to e469f
-
No actionable merge-blocking issue remains; the change is ready to merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description explains the problem, the behavior change, affected components, and validation results. It does not use every template heading and omits the explicit compatibility, security, and related-issue sections, but it is mostly complete and directly relevant.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Summary
MJML allows
mj-rawinsidemj-sectionandmj-group. Both components rendered only their column children, so raw content in those places was dropped from the output.Raw children now render verbatim, in document order, outside the Outlook column cells. This matches the reference renderer, where
renderWrappedChildrenreturnsisRawElement()children as they are. Raw children do not count towards column widths.MjColumnandMjWrapperalready keep raw children, so they are unchanged.Tests
raw-in-sectionandraw-in-group, generated withmjml@4.18.0. All 42 golden comparisons pass.mvn verifypasses on all modules (1,151 tests, Spotless, SpotBugs, JaCoCo, Javadoc).Summary by CodeRabbit