Fix rendering issues in form blocks
[MAILPOET-3415]
This commit is contained in:
committed by
Veljko V
parent
6e911ffd1d
commit
c1aef842d2
@@ -2,7 +2,16 @@
|
||||
|
||||
namespace MailPoet\Form\Block;
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Paragraph {
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
public function __construct(WPFunctions $wp) {
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
public function render(array $block): string {
|
||||
$content = ($block['params']['content'] ?? '');
|
||||
return $this->wrapContent($content, $block);
|
||||
@@ -51,7 +60,7 @@ class Paragraph {
|
||||
return null;
|
||||
}
|
||||
return 'class="'
|
||||
. join(' ', $classes)
|
||||
. $this->wp->escAttr(join(' ', $classes))
|
||||
. '"';
|
||||
}
|
||||
|
||||
@@ -76,7 +85,7 @@ class Paragraph {
|
||||
return null;
|
||||
}
|
||||
return 'style="'
|
||||
. join('; ', $styles)
|
||||
. $this->wp->escAttr(join('; ', $styles))
|
||||
. '"';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user