Remove Empty Tags In Imperavi Redactor
Using Imperavi Redactor with Yii 2 framework. When no text is entered, Imperavi Redactor produces this markup:
Solution 1:
Found this solution:
use yii\helpers\HtmlPurifier;
$text = HtmlPurifier::process($model->text, [
'HTML.ForbiddenElements' => ['p', 'br', ' '],
]);
Post a Comment for "Remove Empty Tags In Imperavi Redactor"