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];