Make sure Heading block parameters are defined before setting
[MAILPOET-4411]
This commit is contained in:
@@ -42,7 +42,7 @@ class Heading {
|
|||||||
if ($classes) {
|
if ($classes) {
|
||||||
$result[] = $classes;
|
$result[] = $classes;
|
||||||
}
|
}
|
||||||
if (isset($block['params']['anchor'])) {
|
if (!empty($block['params']['anchor'])) {
|
||||||
$result[] = $this->renderAnchor($block);
|
$result[] = $this->renderAnchor($block);
|
||||||
}
|
}
|
||||||
$styles = $this->renderStyle($block);
|
$styles = $this->renderStyle($block);
|
||||||
@@ -86,10 +86,10 @@ class Heading {
|
|||||||
|
|
||||||
private function renderStyle(array $block): string {
|
private function renderStyle(array $block): string {
|
||||||
$styles = [];
|
$styles = [];
|
||||||
if (isset($block['params']['align'])) {
|
if (!empty($block['params']['align'])) {
|
||||||
$styles[] = 'text-align: ' . $block['params']['align'];
|
$styles[] = 'text-align: ' . $block['params']['align'];
|
||||||
}
|
}
|
||||||
if (isset($block['params']['text_color'])) {
|
if (!empty($block['params']['text_color'])) {
|
||||||
$styles[] = 'color: ' . $block['params']['text_color'];
|
$styles[] = 'color: ' . $block['params']['text_color'];
|
||||||
}
|
}
|
||||||
if (!empty($block['params']['font_size'])) {
|
if (!empty($block['params']['font_size'])) {
|
||||||
|
Reference in New Issue
Block a user