Remove top padding for ALC & Post block titles

[MAILPOET-1701]
This commit is contained in:
Jan Jakeš
2019-03-06 13:11:51 +01:00
committed by M. Shull
parent 8d689f4f60
commit 51de087c01
3 changed files with 2 additions and 13 deletions

View File

@ -237,7 +237,6 @@ class PostTransformer {
private function getTitle($post) {
$title = $this->sanitizeTitle($post->post_title);
$top_padding = '20px';
if (filter_var($this->args['titleIsLink'], FILTER_VALIDATE_BOOLEAN)) {
$title = '<a href="' . $this->wp->getPermalink($post->ID) . '">' . $title . '</a>';
@ -247,7 +246,6 @@ class PostTransformer {
$tag = $this->args['titleFormat'];
} elseif ($this->args['titleFormat'] === 'ul') {
$tag = 'li';
$top_padding = '0';
} else {
$tag = 'h1';
}
@ -258,11 +256,6 @@ class PostTransformer {
return array(
'type' => 'text',
'text' => $title,
'styles' => [
'block' => [
'paddingTop' => $top_padding,
],
]
);
}

View File

@ -8,7 +8,6 @@ use MailPoet\Util\pQuery\pQuery;
class Text {
static function render($element) {
$html = $element['text'];
$padding_top = isset($element['styles']['block']['paddingTop']) ? 'padding-top:' . $element['styles']['block']['paddingTop'] : '';
// replace &nbsp; with spaces
$html = str_replace('&nbsp;', ' ', $html);
$html = str_replace('\xc2\xa0', ' ', $html);
@ -19,7 +18,7 @@ class Text {
$html = self::removeLastLineBreak($html);
$template = '
<tr>
<td class="mailpoet_text mailpoet_padded_vertical mailpoet_padded_side" valign="top" style="word-break:break-word;word-wrap:break-word;' . $padding_top .'">
<td class="mailpoet_text mailpoet_padded_vertical mailpoet_padded_side" valign="top" style="word-break:break-word;word-wrap:break-word;">
' . $html . '
</td>
</tr>';

View File

@ -1,8 +1,5 @@
<div class="mailpoet_tools"></div>
<div
class="mailpoet_content mailpoet_text_content"
{{#if model.styles.block.paddingTop }}style="padding-top:{{model.styles.block.paddingTop}};"{{/if}}
>
<div class="mailpoet_content mailpoet_text_content">
{{{ model.text }}}
</div>
<div class="mailpoet_block_highlight"></div>