diff --git a/lib/Form/Block/Heading.php b/lib/Form/Block/Heading.php index e2cad73001..51c06b3d2d 100644 --- a/lib/Form/Block/Heading.php +++ b/lib/Form/Block/Heading.php @@ -80,6 +80,12 @@ class Heading { if (isset($block['params']['text_color'])) { $styles[] = 'color: ' . $block['params']['text_color']; } + if (!empty($block['params']['font_size'])) { + $styles[] = 'font-size: ' . $block['params']['font_size'] . 'px'; + } + if (!empty($block['params']['line_height'])) { + $styles[] = 'line-height: ' . $block['params']['line_height']; + } if (!empty($block['params']['background_color'])) { $styles[] = 'background-color: ' . $block['params']['background_color']; } diff --git a/lib/Form/Block/Paragraph.php b/lib/Form/Block/Paragraph.php index c9530a7f3d..f17a6398a3 100644 --- a/lib/Form/Block/Paragraph.php +++ b/lib/Form/Block/Paragraph.php @@ -66,6 +66,9 @@ class Paragraph { if (!empty($block['params']['font_size'])) { $styles[] = 'font-size: ' . $block['params']['font_size'] . 'px'; } + if (!empty($block['params']['line_height'])) { + $styles[] = 'line-height: ' . $block['params']['line_height']; + } if (empty($styles)) { return null; } diff --git a/tests/unit/Form/Block/HeadingTest.php b/tests/unit/Form/Block/HeadingTest.php index 4304b00ec9..c1a684584b 100644 --- a/tests/unit/Form/Block/HeadingTest.php +++ b/tests/unit/Form/Block/HeadingTest.php @@ -91,4 +91,24 @@ class HeadingTest extends \MailPoetUnitTest { expect($html)->contains('style="background-color: red'); expect($html)->contains('class="mailpoet-has-background-color"'); } + + public function testItShouldRenderFontSize() { + $html = $this->heading->render([ + 'params' => [ + 'content' => 'Header', + 'font_size' => '33', + ], + ]); + expect($html)->equals('
Paragraph
'); } + public function testItShouldRenderLineHeight() { + $html = $this->paragraph->render([ + 'params' => [ + 'content' => 'Paragraph', + 'line_height' => '2.3', + ], + ]); + expect($html)->equals('Paragraph
'); + } + public function testItShouldRenderDropCap() { $html = $this->paragraph->render([ 'params' => [