From f557bfb7a18f84cfcbc922591d57c3f773546cb4 Mon Sep 17 00:00:00 2001 From: Jonathan Philipp Date: Thu, 9 Jul 2026 12:39:50 +0200 Subject: [PATCH] fix: remove outlook only styles from mjmlElementRendererImplementation --- .../FusionObjects/MjmlElementRendererImplementation.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Classes/Fusion/FusionObjects/MjmlElementRendererImplementation.php b/Classes/Fusion/FusionObjects/MjmlElementRendererImplementation.php index 2b9cc37..bb8f715 100644 --- a/Classes/Fusion/FusionObjects/MjmlElementRendererImplementation.php +++ b/Classes/Fusion/FusionObjects/MjmlElementRendererImplementation.php @@ -84,8 +84,13 @@ public function evaluate() ->validationLevel(ValidationLevel::Skip) ->toHtml($mjml); + // Outlook-only rules are applyed conditionally + // (e.g. .mj-outlook-group-fix, which forces mj-group columns to width:100% and breaks side-by-side layout everywhere else). + // We remove them to don't get the styles for outlook applied, which breaks mj-group in all other browsers. + $htmlWithoutMsoConditionals = preg_replace('//', '', $html); + preg_match('/]*>([\s\S]*?)<\/body>/', $html, $bodyMatches); - preg_match_all('/]*>([\s\S]*?)<\/style>/', $html, $styleMatches); + preg_match_all('/]*>([\s\S]*?)<\/style>/', $htmlWithoutMsoConditionals, $styleMatches); $body = $bodyMatches[1];