From 93674929b06f6fb87279cad65de1cd7c60915150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lys=C3=BD?= Date: Thu, 30 Sep 2021 12:34:31 +0200 Subject: [PATCH] Add spacing at end of the paragraph when next element is heading [MAILPOET-3474] --- lib/Newsletter/Renderer/Blocks/Text.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Newsletter/Renderer/Blocks/Text.php b/lib/Newsletter/Renderer/Blocks/Text.php index 0cb1390280..ae349c6b35 100644 --- a/lib/Newsletter/Renderer/Blocks/Text.php +++ b/lib/Newsletter/Renderer/Blocks/Text.php @@ -120,8 +120,8 @@ class Text { $lineBreaks; if ($paragraph->hasClass(PostContentManager::WP_POST_CLASS)) { $paragraph->removeClass(PostContentManager::WP_POST_CLASS); - // if this element is followed by a paragraph, add double line breaks - $lineBreaks = ($nextElement && preg_match('/

getOuterText())) ? + // if this element is followed by a paragraph or heading, add double line breaks + $lineBreaks = ($nextElement && preg_match('/<(p|h[1-6]{1})/i', $nextElement->getOuterText())) ? '

' : $lineBreaks; }