Merge updates in trunk
MAILPOET-5643
This commit is contained in:
committed by
Jan Lysý
parent
d05b38bf89
commit
667da710b1
@@ -124,21 +124,6 @@ p {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resetting default browser margins to ensuring the same look in browser, email client and email editor */
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul,
|
|
||||||
ol,
|
|
||||||
li {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
/* Wa want ensure the same design for all email clients */
|
/* Wa want ensure the same design for all email clients */
|
||||||
ul,
|
ul,
|
||||||
ol {
|
ol {
|
||||||
|
@@ -8,13 +8,13 @@ use MailPoet\EmailEditor\Engine\SettingsController;
|
|||||||
class Heading implements BlockRenderer {
|
class Heading implements BlockRenderer {
|
||||||
public function render($blockContent, array $parsedBlock, SettingsController $settingsController): string {
|
public function render($blockContent, array $parsedBlock, SettingsController $settingsController): string {
|
||||||
$contentStyles = $settingsController->getEmailContentStyles();
|
$contentStyles = $settingsController->getEmailContentStyles();
|
||||||
return str_replace('{heading_content}', $blockContent, $this->prepareColumnTemplate($parsedBlock, $contentStyles));
|
return str_replace('{heading_content}', $blockContent, $this->getBlockWrapper($parsedBlock, $contentStyles));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Based on MJML <mj-text>
|
* Based on MJML <mj-text>
|
||||||
*/
|
*/
|
||||||
private function prepareColumnTemplate(array $parsedBlock, array $contentStyles): string {
|
private function getBlockWrapper(array $parsedBlock, array $contentStyles): string {
|
||||||
$styles = [];
|
$styles = [];
|
||||||
foreach ($parsedBlock['email_attrs'] ?? [] as $property => $value) {
|
foreach ($parsedBlock['email_attrs'] ?? [] as $property => $value) {
|
||||||
$styles[$property] = $value;
|
$styles[$property] = $value;
|
||||||
@@ -28,9 +28,19 @@ class Heading implements BlockRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return '
|
return '
|
||||||
<div style="' . $this->convertStylesToString($styles) . '">
|
<table
|
||||||
{heading_content}
|
role="presentation"
|
||||||
</div>
|
border="0"
|
||||||
|
cellpadding="0"
|
||||||
|
cellspacing="0"
|
||||||
|
style="' . $this->convertStylesToString($styles) . '"
|
||||||
|
>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{heading_content}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user