Does not remove padding from the last element in a column

This commit is contained in:
Vlad
2017-07-19 18:50:10 -04:00
committed by pavel-mailpoet
parent 7c30192a03
commit 0865995d21
3 changed files with 0 additions and 30 deletions

View File

@@ -26,10 +26,6 @@ $block-text-line-height = $text-line-height
&.mailpoet_highlight > .mailpoet_block_highlight
border: 1px dashed $block-hover-highlight-color
.mailpoet_block:last-child
margin-bottom: 0
.mailpoet_content
position: relative
line-height: $block-text-line-height

View File

@@ -11,7 +11,6 @@ class Renderer {
$this->getOneColumnTemplate($styles, $class) :
$this->getMultipleColumnsTemplate($styles, $width, $alignment, $class);
$result = array_map(function($content) use ($template) {
$content = Renderer::removePaddingFromLastElement($content);
return $template['content_start'] . $content . $template['content_end'];
}, $columns_data);
$result = implode('', $result);
@@ -79,10 +78,6 @@ class Renderer {
return $template;
}
function removePaddingFromLastElement($element) {
return preg_replace('/mailpoet_padded_bottom(?!.*mailpoet_padded_bottom)/ism', '', $element);
}
function getBackgroundColor($styles) {
if(!isset($styles['backgroundColor'])) return false;
$background_color = $styles['backgroundColor'];

View File

@@ -113,26 +113,6 @@ class RendererTest extends \MailPoetTest {
expect($rendered_column_content)->equals($column_content);
}
function testItRemovesPaddingFromLastColumnElement() {
$column_content = array('
<tr><td class="mailpoet_padded_bottom"></td></tr>
<tr><td class="mailpoet_padded_bottom"></td></tr>
<tr><td class="mailpoet_padded_bottom"></td></tr>
<tr><td class="mailpoet_padded_bottom"></td></tr>'
);
$column_styles = array(
'block' => array(
'backgroundColor' => "#999999"
)
);
$rendered_column_content = $this->column_renderer->render(
$column_styles,
count($column_content),
$column_content
);
expect(substr_count($rendered_column_content, 'mailpoet_padded'))->equals(3);
}
function testItRendersHeader() {
$newsletter = $this->newsletter['body'];
$template = $newsletter['content']['blocks'][0]['blocks'][0]['blocks'][0];
@@ -144,7 +124,6 @@ class RendererTest extends \MailPoetTest {
expect($DOM('td', 0)->attr('style'))->notEmpty();
}
function testItRendersImage() {
$newsletter = $this->newsletter['body'];
$template = $newsletter['content']['blocks'][0]['blocks'][0]['blocks'][1];