Add spacing at end of the paragraph when next element is heading

[MAILPOET-3474]
This commit is contained in:
Jan Lysý
2021-09-30 12:34:31 +02:00
committed by Veljko V
parent e2c1534ea9
commit 93674929b0

View File

@@ -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('/<p/i', $nextElement->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())) ?
'<br /><br />' :
$lineBreaks;
}