Commit 1fa1297f34c for woocommerce
commit 1fa1297f34c7dc302562adde4126b6c2e696a43a
Author: Rishabh Gupta <109821717+R1shabh-Gupta@users.noreply.github.com>
Date: Tue Aug 11 19:03:45 2026 +0530
[Email Editor] Fix long unbreakable words breaking email layout (#67519)
* Prevent long unbreakable words from breaking email layout
* Add changelog entry for long word overflow fix
diff --git a/packages/php/email-editor/changelog/fix-paragraph-heading-long-word-overflow b/packages/php/email-editor/changelog/fix-paragraph-heading-long-word-overflow
new file mode 100644
index 00000000000..beffdd0088a
--- /dev/null
+++ b/packages/php/email-editor/changelog/fix-paragraph-heading-long-word-overflow
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Prevent long unbreakable words in paragraph, heading, and site title blocks from expanding the wrapping table and breaking the rendered email layout.
diff --git a/packages/php/email-editor/src/Integrations/Core/Renderer/Blocks/class-text.php b/packages/php/email-editor/src/Integrations/Core/Renderer/Blocks/class-text.php
index 6e0f44ebf28..fb66c161704 100644
--- a/packages/php/email-editor/src/Integrations/Core/Renderer/Blocks/class-text.php
+++ b/packages/php/email-editor/src/Integrations/Core/Renderer/Blocks/class-text.php
@@ -66,7 +66,8 @@ class Text extends Abstract_Block_Renderer {
$block_styles = Styles_Helper::get_block_styles( $block_attributes, $rendering_context, array( 'spacing', 'border', 'background-color', 'color', 'typography' ) );
$additional_styles = array(
- 'min-width' => '100%', // prevent Gmail App from shrinking the table on mobile devices.
+ 'min-width' => '100%', // prevent Gmail App from shrinking the table on mobile devices.
+ 'word-break' => 'break-word', // prevent long unbreakable words (e.g. URLs) from expanding the table and breaking the email layout.
);
// Add fallback text color when no custom text color or preset text color is set.
diff --git a/packages/php/email-editor/src/Integrations/Core/class-initializer.php b/packages/php/email-editor/src/Integrations/Core/class-initializer.php
index 020c44d42c3..46c79af04e8 100644
--- a/packages/php/email-editor/src/Integrations/Core/class-initializer.php
+++ b/packages/php/email-editor/src/Integrations/Core/class-initializer.php
@@ -146,6 +146,7 @@ class Initializer {
$allowed_styles[] = 'mso-padding-alt';
$allowed_styles[] = 'mso-font-width';
$allowed_styles[] = 'mso-text-raise';
+ $allowed_styles[] = 'word-break';
return $allowed_styles;
}